Back to index

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

Container for all possible variation test cases for a method. More...

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

List of all members.

Public Member Functions

 __construct ($osl)
 setMethod (gtMethod $method)
 Sets the method to be tested.
 constructAll ()
 Constructs all variation tests in $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

 $method
 $optionalSections
 $variationTests
 $dataTypes

Detailed Description

Container for all possible variation test cases for a method.

Definition at line 5 of file gtVariationContainerMethod.php.


Constructor & Destructor Documentation

Definition at line 10 of file gtVariationContainerMethod.php.

                                    {
    $this->optionalSections = $osl;
  }

Member Function Documentation

Constructs all variation tests in $this_variationTests.

Reimplemented from gtVariationContainer.

Definition at line 29 of file gtVariationContainerMethod.php.

                                 {
    
    $numberOfArguments = count($this->method->getMandatoryArgumentNames()) + count($this->method->getOptionalArgumentNames());
    
    for($i = 1; $i <= $numberOfArguments; $i++) {
      
      foreach ($this->dataTypes as $d) {
        
        $testCase = gtVariationTestCase::getInstance($this->optionalSections, 'method');
        $testCase->setUp($this->method, $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 the method to be tested.

Parameters:
gtMethod$method

Definition at line 20 of file gtVariationContainerMethod.php.

                                              {
    $this->method = $method;
  }

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 7 of file gtVariationContainerMethod.php.

Definition at line 8 of file gtVariationContainerMethod.php.

gtVariationContainer::$variationTests [protected, inherited]

Definition at line 8 of file gtVariationContainer.php.


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