Lines Matching refs:this
21 if($minor < 3) { die("Sorry, you need PHP version 5.3 or greater to run this.\n"); }
141 $this->functionName = $functionName;
150 $function= new ReflectionFunction($this->functionName);
154 $this->optionalArgumentNames[] = $param->getName();
156 $this->mandatoryArgumentNames[] = $param->getName();
168 return $this->functionName;
269 -h ............................... Print this message
463 if ($this->isShortOption($argv[$i])) {
469 if (!in_array($option, array_merge($this->shortOptions, $this->shortOptionsWithArgs)))
474 if (in_array($option, $this->shortOptions)) {
475 $this->options[$option] = true;
479 if (!$this->isValidOptionArg($argv, $i + 1))
485 $this->options[$option] = $argv[$i];
494 if (!isset($this->options[$option])) {
497 return $this->options[$option];
506 return isset($this->options[$option]);
671 foreach ($this->preConditions as $preCon) {
700 if(array_key_exists($option, $this->optSections )) {
701 $this->optSections[$option] = true;
708 $this->skipifKey = $commandLineOptions->getOption('k');
712 $this->skipifExt = $commandLineOptions->getOption('x');
721 return $this->optSections;
726 return $this->skipifKey;
730 return $this->skipifExt;
734 return $this->optSections['skipif'];
738 if($this->skipifKey != '') {
745 if($this->skipifExt != '') {
751 return $this->optSections['ini'];
755 return $this->optSections['clean'];
759 return $this->optSections['done'];
850 $this->className = $className;
851 $this->methodName = $methodName;
860 $reflectionClass = new ReflectionClass($this->className);
864 $this->constructorArgumentNames[] = $param->getName();
876 $methodClass = new reflectionMethod($this->className, $this->methodName);
881 $this->optionalArgumentNames[] = $param->getName();
883 $this->mandatoryArgumentNames[] = $param->getName();
896 return $this->constructorArgumentNames;
905 return $this->methodName;
915 return $this->className;
923 if(count ($this->constructorArgumentNames) > 0) {
925 for( $i = 0; $i < count( $this->constructorArgumentNames ); $i++) {
926 $this->constructorArgumentList .= "\$".$this->constructorArgumentNames[$i].", ";
928 $this->constructorArgumentList = substr($this->constructorArgumentList, 0, -2);
939 return $this->constructorArgumentList;
948 if(count ($this->constructorArgumentNames) > 0) {
949 foreach( $this->constructorArgumentNames as $name) {
950 $this->constructorInitialisationStatements[] = "\$".$name." = ";
963 return $this->constructorInitialisationStatements;
967 */if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test is not for Windows platforms");
984 …);foreach ( $variation_array as $var ) {if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is …
998 );if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only");
999 if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platforms only");
1060 return $this->mandatoryArgumentNames;
1070 return $this->optionalArgumentNames;
1074 $this->setValidArgumentLists();
1075 $this->setExtraArgumentList();
1076 $this->setShortArgumentList();
1084 if(count ($this->mandatoryArgumentNames) > 0) {
1085 for( $i = 0; $i < count( $this->mandatoryArgumentNames ); $i++) {
1086 $this->extraArgumentList .= "\$".$this->mandatoryArgumentNames[$i].", ";
1090 if(count ($this->optionalArgumentNames) > 0) {
1091 for( $i = 0; $i < count( $this->optionalArgumentNames ); $i++) {
1092 $this->extraArgumentList .= "\$".$this->optionalArgumentNames[$i].", ";
1096 $this->extraArgumentList= $this->extraArgumentList. "\$extra_arg";
1106 return $this->extraArgumentList;
1116 if(count ($this->mandatoryArgumentNames) > 0) {
1117 for( $i = 0; $i < count( $this->mandatoryArgumentNames ) - 1; $i++) {
1118 $this->shortArgumentList .= "\$".$this->mandatoryArgumentNames[$i].", ";
1120 $this->shortArgumentList = substr($this->shortArgumentList, 0, -2);
1131 return $this->shortArgumentList;
1140 $this->allowedArgumentLists[0] = '';
1141 if(count ($this->mandatoryArgumentNames) > 0) {
1142 for( $i = 0; $i < count( $this->mandatoryArgumentNames ); $i++) {
1143 $this->allowedArgumentLists[0] .= "\$".$this->mandatoryArgumentNames[$i].", ";
1147 if(count ($this->optionalArgumentNames) > 0) {
1148 for( $i = 0; $i < count( $this->optionalArgumentNames ); $i++) {
1149 …$this->allowedArgumentLists[] = $this->allowedArgumentLists[$i]."\$".$this->optionalArgumentNames[…
1150 $this->allowedArgumentLists[$i] = substr ($this->allowedArgumentLists[$i], 0, -2);
1154 …$this->allowedArgumentLists[count($this->allowedArgumentLists) -1 ] = substr($this->allowedArgumen…
1164 return $this->allowedArgumentLists;
1174 return end($this->allowedArgumentLists);
1183 if(count ($this->mandatoryArgumentNames) > 0) {
1184 foreach( $this->mandatoryArgumentNames as $name) {
1185 $this->initialisationStatements[] = "\$".$name." = ";
1188 if(count ($this->optionalArgumentNames) > 0) {
1189 foreach( $this->optionalArgumentNames as $name) {
1190 $this->initialisationStatements[] = "\$".$name." = ";
1201 return $this->initialisationStatements;
1214 $this->optionalSections = $osl;
1224 $this->method = $method;
1234 …$numberOfArguments = count($this->method->getMandatoryArgumentNames()) + count($this->method->getO…
1238 foreach ($this->dataTypes as $d) {
1240 $testCase = gtVariationTestCase::getInstance($this->optionalSections, 'method');
1241 $testCase->setUp($this->method, $i, $d);
1243 $this->variationTests[] = $testCase->toString();
1257 $this->optionalSections = $opt;
1266 $this->subject = $method;
1270 $this->constructCommonHeaders();
1272 $this->addBasicEcho();
1274 $this->constructorArgInit();
1275 $this->constructorCreateInstance();
1277 $this->constructSubjectCalls();
1279 $this->constructCommonClosing();
1284 $this->testCase[] = "--TEST--";
1285 …$this->testCase[] = "Test class ".$this->subject->getClassName()." method ".$this->subject->getNa…
1290 $lists = $this->subject->getValidArgumentLists();
1293 $this->testCase[] = "var_dump( \$class->".$this->subject->getName()."( ".$list." ) );";
1294 $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
1296 $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase );
1330 return $this->shortArgumentList;
1334 return $this->longArgumentList;
1338 $this->argInit();
1341 $this->testCase[] = "\$extra_arg = ";
1343 $this->subjectCalls();
1347 …$this->testCase[] = "echo \"*** Test by calling method or function with incorrect numbers of argum…
1348 $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
1391 foreach($this->testCase as $line) {
1405 return $this->testCase;
1414 $this->testHeader();
1416 if($this->optionalSections->hasSkipif()) {
1417 $this->addSkipif();
1420 if($this->optionalSections->hasIni()) {
1421 $this->addIni();
1424 $this->fileOpening();
1433 $this->fileClosing();
1435 if ($this->optionalSections->hasDone()) {
1436 $this->addDone();
1439 if ($this->optionalSections->hasClean()) {
1440 $this->addClean();
1443 $this->addExpectf();
1451 $this->testCase[] = "--FILE--";
1452 $this->testCase[] = "<?php";
1453 $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase );
1462 $conStatements = $this->subject->getConstructorInitStatements();
1464 $this->testCase[] = $statement;
1474 $constructorList = $this->subject->getConstructorArgumentList();
1475 $this->testCase[] = "\$class = new ".$this->subject->getClassName()."( ".$constructorList." );";
1476 $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase );
1485 $statements = $this->subject->getInitialisationStatements();
1487 $this->testCase[] = $statement;
1489 $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase );
1498 $this->testCase[] = "?>";
1507 $this->testCase[] = "--SKIPIF--";
1508 $this->testCase[] = "<?php";
1509 if($this->optionalSections->hasSkipifKey()) {
1510 $key = $this->optionalSections->getSkipifKey();
1513 $this->testCase = gtCodeSnippet::append('skipifwin', $this->testCase);
1516 $this->testCase = gtCodeSnippet::append('skipifnotwin', $this->testCase);
1520 $this->testCase = gtCodeSnippet::append('skipif64b', $this->testCase);
1524 $this->testCase = gtCodeSnippet::append('skipifnot64b', $this->testCase);
1528 if($this->optionalSections->hasSkipifExt()) {
1529 $ext = $this->optionalSections->getSkipifExt();
1530 …$this->testCase[] = "if (!extension_loaded('$ext')) die ('skip $ext extension not available in thi…
1532 $this->testCase[] = "?>";
1541 $this->testCase[] = "--INI--";
1542 $this->testCase[] = "";
1551 $this->testCase[] = "--CLEAN--";
1552 $this->testCase[] = "<?php";
1553 $this->testCase[] = "?>";
1562 $this->testCase[] = "===DONE===";
1571 $this->testCase[] = "--EXPECTF--";
1572 if ($this->optionalSections->hasDone() ){
1573 $this->testCase[] = '===DONE===';
1578 return $this->optionalSections;
1591 $this->optionalSections = $opt;
1600 $this->subject = $function;
1604 $this->constructCommonHeaders();
1606 $this->addBasicEcho();
1608 $this->constructSubjectCalls();
1610 $this->constructCommonClosing();
1621 $this->testCase[] = "--TEST--";
1622 …$this->testCase[] = "Test function ".$this->subject->getName()."() by calling it with its expected…
1631 $lists = $this->subject->getValidArgumentLists();
1635 $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
1636 $this->testCase[] = "var_dump(".$this->subject->getName()."( ".$list." ) );";
1638 $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase );
1651 $this->optionalSections = $opt;
1660 $this->subject = $function;
1669 $this->constructCommonHeaders();
1671 $this->addErrorEcho();
1673 $this->constructSubjectCalls();
1675 $this->constructCommonClosing();
1681 $this->testCase[] = "--TEST--";
1682 …$this->testCase[] = "Test function ".$this->subject->getName()."() by calling it more than or less…
1687 $list = $this->subject->getExtraArgumentList();
1688 $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
1689 $this->testCase[] = "var_dump(".$this->subject->getName()."( ".$list." ) );";
1691 $list = $this->subject->getShortArgumentList();
1692 $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
1693 $this->testCase[] = "var_dump(".$this->subject->getName()."( ".$list." ) );";
1694 $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase );
1710 $this->optionalSections = $opt;
1720 $this->subject = $function;
1721 $this->argumentNumber = $argumentNumber;
1722 $this->variationData = $variationData;
1732 $this->constructCommonHeaders();
1734 $this->addVariationEcho();
1736 $this->constructSubjectCalls();
1738 $this->constructCommonClosing();
1742 $this->testCase[] = "--TEST--";
1743 …$this->testCase[] = "Test function ".$this->subject->getName()."() by substituting argument ".$thi…
1748 $this->testCase = gtCodeSnippet::append('loopStart', $this->testCase);
1751 $argumentList = explode(",", $this->subject->getMaximumArgumentList());
1752 $argumentList[$this->argumentNumber -1 ] = "\$var ";
1756 $this->testCase[] = " var_dump(".$this->subject->getName()."( ".$list." ) );";
1757 $this->testCase = gtCodeSnippet::append('loopClose', $this->testCase);
1772 $this->optionalSections = $osl;
1781 $this->function = $function;
1786 * constructs all possible variation testcases in array $this->variationTests
1792 …$numberOfArguments = count($this->function->getMandatoryArgumentNames()) + count($this->function->…
1794 foreach ($this->dataTypes as $d) {
1795 $testCase = gtVariationTestCase::getInstance($this->optionalSections);
1796 $testCase->setUp($this->function, $i, $d);
1798 $this->variationTests[] = $testCase->toString();
1812 $this->optionalSections = $opt;
1822 $this->subject = $method;
1831 $this->constructCommonHeaders();
1833 $this->addErrorEcho();
1835 $this->constructorArgInit();
1836 $this->constructorCreateInstance();
1838 $this->constructSubjectCalls();
1840 $this->constructCommonClosing();
1844 $this->testCase[] = "--TEST--";
1845 …$this->testCase[] = "Test class ".$this->subject->getClassName()." method ".$this->subject->getNam…
1851 $list = $this->subject->getExtraArgumentList();
1852 $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
1853 $this->testCase[] = "var_dump(".$this->subject->getName()."( ".$list." ) );";
1855 $list = $this->subject->getShortArgumentList();
1856 $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
1857 $this->testCase[] = "var_dump(".$this->subject->getName()."( ".$list." ) );";
1888 $this->argInit();
1889 $this->subjectCalls();
1893 …$this->testCase[] = "echo \"*** Test by calling method or function with its expected arguments ***…
1894 $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
1946 return $this->variationTests;
1978 $statements = $this->subject->getInitialisationStatements();
1980 if($i != ( $this->argumentNumber -1) ) {
1981 $this->testCase[] = $statements[$i];
1984 $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase );
1988 $this->testCase = gtCodeSnippet::append($this->variationData, $this->testCase);
1989 $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase );
1993 $this->argInitVariation();
1994 $this->addVariationCode();
1995 $this->subjectCalls();
1999 …$this->testCase[] = "echo \"*** Test substituting argument ".$this->argumentNumber." with ".$this-…
2000 $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase );
2017 $this->optionalSections = $opt;
2028 $this->subject = $method;
2029 $this->argumentNumber = $argumentNumber;
2030 $this->variationData = $variationData;
2039 $this->constructCommonHeaders();
2041 $this->addVariationEcho();
2043 $this->constructorArgInit();
2044 $this->constructorCreateInstance();
2046 $this->constructSubjectcalls();
2047 $this->constructCommonClosing();
2052 $this->testCase[] = "--TEST--";
2053 …this->testCase[] = "Test class ".$this->subject->getClassName()." method ".$this->subject->getName…
2057 $this->testCase = gtCodeSnippet::append('loopStart', $this->testCase);
2059 $argumentList = explode(",", $this->subject->getMaximumArgumentList());
2060 $argumentList[$this->argumentNumber -1 ] = "\$var ";
2064 $this->testCase[] = " var_dump(\$class->".$this->subject->getName()."( ".$list." ) );";
2065 $this->testCase = gtCodeSnippet::append('loopClose', $this->testCase);