1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 04:02:19 +02:00
Files
archived-php-src/scripts/dev/generate-phpt/src/testcase/gtVariationContainerMethod.php
2009-05-07 09:21:43 +00:00

46 lines
1.0 KiB
PHP

<?php
/**
* Container for all possible variation test cases for a method
*/
class gtVariationContainerMethod extends gtVariationContainer {
protected $method;
protected $optionalSections;
public function __construct($osl) {
$this->optionalSections = $osl;
}
/**
* Sets the method to be tested
*
* @param gtMethod $method
*/
public function setMethod(gtMethod $method) {
$this->method = $method;
}
/**
* Constructs all variation tests in $this_variationTests
*
*/
public function constructAll() {
$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();
}
}
}
}
?>