Back to index

php5  5.3.10
Public Member Functions | Static Public Member Functions | Protected Attributes
gtVariationContainerFunction Class Reference

Container for all possible variation test cases of functions. More...

Inheritance diagram for gtVariationContainerFunction:
Inheritance graph
[legend]
Collaboration diagram for gtVariationContainerFunction:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 __construct ($osl)
 setFunction (gtFunction $function)
 Sets function being tested.
 constructAll ()
 Constucts all possible variation testcases in array $this->variationTests.
 getVariationTests ()
 Returns all varaition tests as an array of arrays.

Static Public Member Functions

static getInstance ($optionalSections, $type= 'function')
 Return an instance of a containers for either function or method tests.

Protected Attributes

 $function
 $optionalSections
 $variationTests
 $dataTypes

Detailed Description

Container for all possible variation test cases of functions.

Definition at line 6 of file gtVariationContainerFunction.php.


Constructor & Destructor Documentation

Definition at line 11 of file gtVariationContainerFunction.php.

                                    {
    $this->optionalSections = $osl;
  }

Member Function Documentation

Constucts all possible variation testcases in array $this->variationTests.

Reimplemented from gtVariationContainer.

Definition at line 29 of file gtVariationContainerFunction.php.

                                 {
    
        
    $numberOfArguments = count($this->function->getMandatoryArgumentNames()) + count($this->function->getOptionalArgumentNames());
    for($i = 1; $i <= $numberOfArguments; $i++) {
      foreach ($this->dataTypes as $d) {
        $testCase = gtVariationTestCase::getInstance($this->optionalSections);
        $testCase->setUp($this->function, $i, $d);
        $testCase->constructTestCase();
        $this->variationTests[] = $testCase->toString();
      }
    }
  }  

Here is the call graph for this function:

static gtVariationContainer::getInstance ( optionalSections,
type = 'function' 
) [static, inherited]

Return an instance of a containers for either function or method tests.

Parameters:
string$type
Returns:
variation test container

Definition at line 28 of file gtVariationContainer.php.

                                                                              {
    
    if($type == 'function') {
      return new gtVariationContainerFunction($optionalSections);
    }
    if($type =='method') {
      return new gtVariationContainerMethod($optionalSections);
    }
    
  }

Here is the caller graph for this function:

Returns all varaition tests as an array of arrays.

Returns:
string

Definition at line 49 of file gtVariationContainer.php.

                                      {
    return $this->variationTests;
  }

Sets function being tested.

Parameters:
gtFunction$function

Definition at line 20 of file gtVariationContainerFunction.php.

                                                    {
    $this->function = $function;
  }

Member Data Documentation

gtVariationContainer::$dataTypes [protected, inherited]
Initial value:
 array (
                         'array',
                         'boolean',
                         'emptyUnsetUndefNull',
                         'float',
                         'int',
                         'object',
                         'string',
                         )

Definition at line 10 of file gtVariationContainer.php.

Definition at line 8 of file gtVariationContainerFunction.php.

Definition at line 9 of file gtVariationContainerFunction.php.

gtVariationContainer::$variationTests [protected, inherited]

Definition at line 8 of file gtVariationContainer.php.


The documentation for this class was generated from the following file: