com phpruntests: Reformatted to conform to PEAR coding standard.: tests/configuration/preconditions/rtIsExecutableSetTest.php
tests/configuration/preconditions/rtIsTestFileSpecifiedTest.php tests/configuration/rtDirectoryListTest.php
tests/configuration/rtEnvironmentVariablesTest.php tests/configuration/rtPreconditionListTest.php tests/configuration/rtRuntestsConfigurationTest.php
tests/configuration/settings/rtPhpExecutableSettingTest.php tests/

From: Date: Fri, 24 Apr 2009 09:42:02 +0000
Subject: com phpruntests: Reformatted to conform to PEAR coding standard.: tests/configuration/preconditions/rtIsExecutableSetTest.php
tests/configuration/preconditions/rtIsTestFileSpecifiedTest.php tests/configuration/rtDirectoryListTest.php
tests/configuration/rtEnvironmentVariablesTest.php tests/configuration/rtPreconditionListTest.php tests/configuration/rtRuntestsConfigurationTest.php
tests/configuration/settings/rtPhpExecutableSettingTest.php tests/
Groups: php.qa 
Request: Send a blank email to php-qa+get-66529@lists.php.net to get a copy of this message
Commit: 50590bdc481a1b47b8af4b9145713aa9fe5f1b5e Author: Stefan Priebsch <spriebsch@php.net> Fri, 24 Apr 2009 09:42:02 +0000 Parents: dc179766539f1025523a85b78f69a7159965c8de Branches: master Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=50590bdc481a1b47b8af4b9145713aa9fe5f1b5e Log: Reformatted to conform to PEAR coding standard. Changed paths: M tests/configuration/preconditions/rtIsExecutableSetTest.php M tests/configuration/preconditions/rtIsTestFileSpecifiedTest.php M tests/configuration/rtDirectoryListTest.php M tests/configuration/rtEnvironmentVariablesTest.php M tests/configuration/rtPreconditionListTest.php M tests/configuration/rtRuntestsConfigurationTest.php M tests/configuration/settings/rtPhpExecutableSettingTest.php M tests/configuration/settings/rtTestFileSettingTest.php M tests/rtTextTest.php M tests/testcase/preconditions/rtHasMandatorySectionsTest.php M tests/testcase/preconditions/rtHasNoDuplicateSectionTest.php M tests/testcase/preconditions/rtIsSectionImplementedTest.php M tests/testcase/preconditions/rtIsValidSectionNameTest.php M tests/testcase/rtCleanExecutionTest.php M tests/testcase/rtPhpRunnerTest.php M tests/testcase/rtPhpTestFileTest.php M tests/testcase/rtTestConfigurationTest.php M tests/testcase/rtTestDifferenceTest.php M tests/testcase/rtTestExecutionTest.php M tests/testcase/rtTestOutputWriterTest.php M tests/testcase/rtTestResultsTest.php M tests/testcase/sections/configurationsections/rtArgsSectionTest.php M tests/testcase/sections/configurationsections/rtEnvSectionTest.php M tests/testcase/sections/configurationsections/rtIniSectionTest.php M tests/testcase/sections/executablesections/rtCleanSectionTest.php M tests/testcase/sections/executablesections/rtFileSectionTest.php M tests/testcase/sections/executablesections/rtSkipIfSectionTest.php M tests/testcase/sections/informationsections/rtCreditsSectionTest.php M tests/testcase/sections/informationsections/rtTestHeaderSectionTest.php M tests/testcase/sections/informationsections/rtXfailSectionTest.php M tests/testcase/sections/outputsections/rtExpectFSectionTest.php M tests/testcase/sections/outputsections/rtExpectRegexSectionTest.php M tests/testcase/sections/outputsections/rtExpectSectionTest.php M tests/testcase/sections/rtSectionTest.php

diff --git a/tests/configuration/preconditions/rtIsExecutableSetTest.php b/tests/configuration/preconditions/rtIsExecutableSetTest.php index 51f8681..c36185d 100644 --- a/tests/configuration/preconditions/rtIsExecutableSetTest.php +++ b/tests/configuration/preconditions/rtIsExecutableSetTest.php @@ -24,7 +24,7 @@ class rtIsExecutableSetTest extends PHPUnit_Framework_TestCase $pre = new rtIsExecutableSet(); - $this->assertTrue($pre->check($clo,$env)); + $this->assertTrue($pre->check($clo, $env)); } public function testGetText() diff --git a/tests/configuration/preconditions/rtIsTestFileSpecifiedTest.php b/tests/configuration/preconditions/rtIsTestFileSpecifiedTest.php index 354ed85..1d93fff 100644 --- a/tests/configuration/preconditions/rtIsTestFileSpecifiedTest.php +++ b/tests/configuration/preconditions/rtIsTestFileSpecifiedTest.php @@ -16,7 +16,7 @@ class rtIsTestFileSpecifiedTest extends PHPUnit_Framework_TestCase $this->assertTrue($pre->check($clo, $env)); } - public function testCLOptionL( + public function testCLOptionL() { $env = rtEnvironmentVariables::getInstance(); $clo = new rtCommandLineOptions(); diff --git a/tests/configuration/rtDirectoryListTest.php b/tests/configuration/rtDirectoryListTest.php index 717a9b4..5af8b02 100644 --- a/tests/configuration/rtDirectoryListTest.php +++ b/tests/configuration/rtDirectoryListTest.php @@ -8,24 +8,24 @@ class rtDirectoryListTestTest extends PHPUnit_Framework_TestCase public function setUp() { $tmpDir = sys_get_temp_dir(). "/top"; - mkdir ($tmpDir); - mkdir ($tmpDir. "/a"); - mkdir ($tmpDir. "/b"); - mkdir ($tmpDir. "/c"); + mkdir($tmpDir); + mkdir($tmpDir. "/a"); + mkdir($tmpDir. "/b"); + mkdir($tmpDir. "/c"); file_put_contents($tmpDir. "/c/afile", "hello"); - mkdir ($tmpDir. "/c/d"); + mkdir($tmpDir. "/c/d"); } public function tearDown() { $tmpDir = sys_get_temp_dir(). "/top"; - rmdir ($tmpDir. "/a"); - rmdir ($tmpDir. "/b"); + rmdir($tmpDir. "/a"); + rmdir($tmpDir. "/b"); - unlink ($tmpDir. "/c/afile"); - rmdir ($tmpDir. "/c/d"); - rmdir ($tmpDir. "/c"); - rmdir ($tmpDir); + unlink($tmpDir. "/c/afile"); + rmdir($tmpDir. "/c/d"); + rmdir($tmpDir. "/c"); + rmdir($tmpDir); } public function testNames() diff --git a/tests/configuration/rtEnvironmentVariablesTest.php b/tests/configuration/rtEnvironmentVariablesTest.php index e825758..a51461b 100644 --- a/tests/configuration/rtEnvironmentVariablesTest.php +++ b/tests/configuration/rtEnvironmentVariablesTest.php @@ -50,7 +50,7 @@ class rtEnvironmentVariablesTest extends PHPUnit_Framework_TestCase $ev->adaptEnvironment(); $ev->getUserSuppliedVariables(); - $this->assertEquals('some-windows-thing', $ev->getVariable('SystemRoot')); + $this->assertEquals('some-windows-thing', $ev->getVariable('SystemRoot')); } } ?> diff --git a/tests/configuration/rtPreconditionListTest.php b/tests/configuration/rtPreconditionListTest.php index 6c7f43e..0f283c7 100644 --- a/tests/configuration/rtPreconditionListTest.php +++ b/tests/configuration/rtPreconditionListTest.php @@ -11,11 +11,11 @@ class rtPreCondtionListTest extends PHPUnit_Framework_TestCase public function setUp() { - $this->clo = new rtCommandLineOptions(); - $this->clo->parse(array('run-tests.php', '-p', 'some-php-exe', 'a-test.phpt')); - - $this->env = rtEnvironmentVariables::getInstance(); - $this->env->getUserSuppliedVariables(); + $this->clo = new rtCommandLineOptions(); + $this->clo->parse(array('run-tests.php', '-p', 'some-php-exe', 'a-test.phpt')); + + $this->env = rtEnvironmentVariables::getInstance(); + $this->env->getUserSuppliedVariables(); } public function testCheck() diff --git a/tests/configuration/rtRuntestsConfigurationTest.php b/tests/configuration/rtRuntestsConfigurationTest.php index b8f0fc6..b90a8c5 100644 --- a/tests/configuration/rtRuntestsConfigurationTest.php +++ b/tests/configuration/rtRuntestsConfigurationTest.php @@ -18,7 +18,7 @@ class rtRuntestsConfigurationTest extends PHPUnit_Framework_TestCase public function testCreateWin() { - $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', 'a-php-exe', 'test.phpt'),'Windows'); + $config = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', 'a-php-exe', 'test.phpt'), 'Windows'); $config->configure(); $testFiles = $config->getSetting('TestFiles'); diff --git a/tests/configuration/settings/rtPhpExecutableSettingTest.php b/tests/configuration/settings/rtPhpExecutableSettingTest.php index b6a3c70..667f2d5 100644 --- a/tests/configuration/settings/rtPhpExecutableSettingTest.php +++ b/tests/configuration/settings/rtPhpExecutableSettingTest.php @@ -11,7 +11,7 @@ class rtPhpExecutableSettingTest extends PHPUnit_Framework_TestCase $clisetting = new rtPhpExecutableSetting($configuration); - $this->assertEquals('a-php-executable', $clisetting->get()); + $this->assertEquals('a-php-executable', $clisetting->get()); } public function testSetPhpExecutableEV() @@ -21,7 +21,7 @@ class rtPhpExecutableSettingTest extends PHPUnit_Framework_TestCase $clisetting = new rtPhpExecutableSetting($configuration); - $this->assertEquals('a-php-executable', $clisetting->get()); + $this->assertEquals('a-php-executable', $clisetting->get()); } public function testSetPhpExecutableEVAuto() diff --git a/tests/configuration/settings/rtTestFileSettingTest.php b/tests/configuration/settings/rtTestFileSettingTest.php index 8ceb4b9..466eb23 100644 --- a/tests/configuration/settings/rtTestFileSettingTest.php +++ b/tests/configuration/settings/rtTestFileSettingTest.php @@ -18,7 +18,7 @@ class rtTestFileSettingTest extends PHPUnit_Framework_TestCase $this->f1 = sys_get_temp_dir() . "/file1"; $fh = fopen($this->f1, 'w'); - foreach($this->testnames as $line) { + foreach ($this->testnames as $line) { fwrite($fh, sys_get_temp_dir() . $line . "\n"); } diff --git a/tests/rtTextTest.php b/tests/rtTextTest.php index 1cbd540..ddc98d9 100644 --- a/tests/rtTextTest.php +++ b/tests/rtTextTest.php @@ -1,13 +1,14 @@ <?php + require_once 'PHPUnit/Framework.php'; require_once dirname(__FILE__) . '/../src/rtAutoload.php'; - class rtHelpTextTest extends PHPUnit_Framework_TestCase { - public function testOutput() { - $words = rtText::get('help'); - $this->assertEquals(substr($words, 0, 9), 'Synopsis:'); - } + public function testOutput() + { + $words = rtText::get('help'); + $this->assertEquals(substr($words, 0, 9), 'Synopsis:'); + } } -?> \ No newline at end of file +?> diff --git a/tests/testcase/preconditions/rtHasMandatorySectionsTest.php b/tests/testcase/preconditions/rtHasMandatorySectionsTest.php index 7afa432..122d438 100644 --- a/tests/testcase/preconditions/rtHasMandatorySectionsTest.php +++ b/tests/testcase/preconditions/rtHasMandatorySectionsTest.php @@ -1,21 +1,23 @@ <?php + require_once 'PHPUnit/Framework.php'; require_once dirname(__FILE__) . '../../../../src/rtAutoload.php'; +class rtHasMandatorySectionsTest extends PHPUnit_Framework_TestCase +{ + public function testHas() + { + $precondition = new rtHasMandatorySections(); + $test = array('TEST','FILE', 'EXPECT'); + $this->assertTrue($precondition->isMet($test)); + } -class rtHasMandatorySectionsTest extends PHPUnit_Framework_TestCase { - - public function testHas() { - $precondition = new rtHasMandatorySections(); - $test = array('TEST','FILE', 'EXPECT'); - $this->assertTrue($precondition->isMet($test)); - } - - public function testHasNot() { - $precondition = new rtHasMandatorySections(); - $test = array('TEST', 'FILE'); - $this->assertEquals("The test case is missing one or more mandatory sections.", trim($precondition->getMessage())); - $this->assertFalse($precondition->isMet($test)); - } + public function testHasNot() + { + $precondition = new rtHasMandatorySections(); + $test = array('TEST', 'FILE'); + $this->assertEquals("The test case is missing one or more mandatory sections.", trim($precondition->getMessage())); + $this->assertFalse($precondition->isMet($test)); + } } -?> \ No newline at end of file +?> diff --git a/tests/testcase/preconditions/rtHasNoDuplicateSectionTest.php b/tests/testcase/preconditions/rtHasNoDuplicateSectionTest.php index a6ec33e..ca885a7 100644 --- a/tests/testcase/preconditions/rtHasNoDuplicateSectionTest.php +++ b/tests/testcase/preconditions/rtHasNoDuplicateSectionTest.php @@ -1,24 +1,25 @@ <?php + require_once 'PHPUnit/Framework.php'; require_once dirname(__FILE__) . '../../../../src/rtAutoload.php'; +class rtHasNoDuplicateSectionTest extends PHPUnit_Framework_TestCase +{ + public function testNoDup() + { + $precondition = new rtHasNoDuplicateSections(); + $test = array('TEST', 'FILE'); -class rtHasNoDuplicateSectionTest extends PHPUnit_Framework_TestCase { - - public function testNoDup() { - $precondition = new rtHasNoDuplicateSections(); - $test = array('TEST', 'FILE'); - - $this->assertTrue($precondition->isMet($test)); - } - - public function testDup() { - $precondition = new rtHasNoDuplicateSections(); - $test = array('TEST', 'TEST'); - $this->assertEquals("The test has duplicate sections.", trim($precondition->getMessage())); - $this->assertFalse($precondition->isMet($test)); - } + $this->assertTrue($precondition->isMet($test)); + } + public function testDup() + { + $precondition = new rtHasNoDuplicateSections(); + $test = array('TEST', 'TEST'); + $this->assertEquals("The test has duplicate sections.", trim($precondition->getMessage())); + $this->assertFalse($precondition->isMet($test)); + } } -?> \ No newline at end of file +?> diff --git a/tests/testcase/preconditions/rtIsSectionImplementedTest.php b/tests/testcase/preconditions/rtIsSectionImplementedTest.php index 3153857..779acf3 100644 --- a/tests/testcase/preconditions/rtIsSectionImplementedTest.php +++ b/tests/testcase/preconditions/rtIsSectionImplementedTest.php @@ -1,21 +1,25 @@ <?php + require_once 'PHPUnit/Framework.php'; require_once dirname(__FILE__) . '../../../../src/rtAutoload.php'; +class rtIsSectionImplementedTest extends PHPUnit_Framework_TestCase +{ + public function testIs() + { + $precondition = new rtIsSectionImplemented(); + $test = array('TEST', 'FILE', 'EXPECT'); -class rtIsSectionImplementedTest extends PHPUnit_Framework_TestCase { + $this->assertTrue($precondition->isMet($test)); + } - public function testIs() { - $precondition = new rtIsSectionImplemented(); - $test = array('TEST', 'FILE', 'EXPECT'); - $this->assertTrue($precondition->isMet($test)); - } + public function testIsNot() + { + $precondition = new rtIsSectionImplemented(); + $test = array('UEXPECT', 'FILE'); - public function testIsNot() { - $precondition = new rtIsSectionImplemented(); - $test = array('UEXPECT', 'FILE'); - $this->assertEquals("The test contains a section which is not implemented yet", trim($precondition->getMessage())); - $this->assertFalse($precondition->isMet($test)); - } + $this->assertEquals("The test contains a section which is not implemented yet", trim($precondition->getMessage())); + $this->assertFalse($precondition->isMet($test)); + } } -?> \ No newline at end of file +?> diff --git a/tests/testcase/preconditions/rtIsValidSectionNameTest.php b/tests/testcase/preconditions/rtIsValidSectionNameTest.php index b26cb52..daf6fd0 100644 --- a/tests/testcase/preconditions/rtIsValidSectionNameTest.php +++ b/tests/testcase/preconditions/rtIsValidSectionNameTest.php @@ -1,22 +1,26 @@ <?php + require_once 'PHPUnit/Framework.php'; require_once dirname(__FILE__) . '../../../../src/rtAutoload.php'; - class rtIsValidSectionNameTest extends PHPUnit_Framework_TestCase { - public function testValid() { - $precondition = new rtIsValidSectionName(); - $test = array('TEST', 'FILE'); - $this->assertTrue($precondition->isMet($test)); - } - public function testInvalid() { - $precondition = new rtIsValidSectionName(); - $test = array('TEXT', 'FILE'); - $this->assertEquals("Test case contains an invalid section.", trim($precondition->getMessage())); - $this->assertFalse($precondition->isMet($test)); - } + public function testValid() + { + $precondition = new rtIsValidSectionName(); + $test = array('TEST', 'FILE'); + + $this->assertTrue($precondition->isMet($test)); + } + + public function testInvalid() + { + $precondition = new rtIsValidSectionName(); + $test = array('TEXT', 'FILE'); + $this->assertEquals("Test case contains an invalid section.", trim($precondition->getMessage())); + $this->assertFalse($precondition->isMet($test)); + } } -?> \ No newline at end of file +?> diff --git a/tests/testcase/rtCleanExecutionTest.php b/tests/testcase/rtCleanExecutionTest.php index 5f20a5e..c403e5a 100644 --- a/tests/testcase/rtCleanExecutionTest.php +++ b/tests/testcase/rtCleanExecutionTest.php @@ -66,7 +66,7 @@ class rtCleanExecutionTest extends PHPUnit_Framework_TestCase $testFile->normaliseLineEndings(); //Create a new test case - $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(),$testFile->getSectionHeadings(), $config); + $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(), $config); //Setup and set the local environment for the test case $testCase->executeTest($config); diff --git a/tests/testcase/rtPhpRunnerTest.php b/tests/testcase/rtPhpRunnerTest.php index 6807fad..bba3409 100644 --- a/tests/testcase/rtPhpRunnerTest.php +++ b/tests/testcase/rtPhpRunnerTest.php @@ -33,9 +33,9 @@ class rtPhpRunnerTest extends PHPUnit_Framework_TestCase public function testStdin() { - $PhpRunner = new rtPhpRunner($this->php .' -n /tmp/test2.php 2>&1', array(), '/tmp', 'hello'); + $PhpRunner = new rtPhpRunner($this->php .' -n /tmp/test2.php 2>&1', array(), '/tmp', 'hello'); - $this->assertEquals("hello", $PhpRunner->runphp()); + $this->assertEquals("hello", $PhpRunner->runphp()); } } diff --git a/tests/testcase/rtPhpTestFileTest.php b/tests/testcase/rtPhpTestFileTest.php index d21cc86..a421cf9 100644 --- a/tests/testcase/rtPhpTestFileTest.php +++ b/tests/testcase/rtPhpTestFileTest.php @@ -46,7 +46,7 @@ class rtPhpTestFileTest extends PHPUnit_Framework_TestCase //..and that they have been successfully removed $this->assertEquals(preg_match("/\r\n/", $fileString), 0); - } + } public function testLinuxLineEndings() { @@ -63,7 +63,7 @@ class rtPhpTestFileTest extends PHPUnit_Framework_TestCase //..and that they have been successfully removed $this->assertEquals(preg_match("/\n/", $fileString), 0); - } + } public function testPreconditionCall() { @@ -72,6 +72,6 @@ class rtPhpTestFileTest extends PHPUnit_Framework_TestCase $testFile->normaliseLineEndings(); $this->assertTrue($testFile->arePreConditionsMet()); - } - } + } +} ?> diff --git a/tests/testcase/rtTestConfigurationTest.php b/tests/testcase/rtTestConfigurationTest.php index a22f412..d8e22a0 100644 --- a/tests/testcase/rtTestConfigurationTest.php +++ b/tests/testcase/rtTestConfigurationTest.php @@ -9,9 +9,9 @@ class rtTestConfigurationTest extends PHPUnit_Framework_TestCase public function setUp() { - $this->sections['ARGS'] = new rtArgsSection('ARGS',array('-vvv -a value -1111 -2 -v')); - $this->sections['ENV'] = new rtEnvSection('ENV',array('env1 = ENV1', 'env2=ENV2')); - $this->sections['INI'] = new rtIniSection('INI',array('error_reporting=E_ALL | E_STRICT | E_DEPRECATED', 'assert.active = 1')); + $this->sections['ARGS'] = new rtArgsSection('ARGS', array('-vvv -a value -1111 -2 -v')); + $this->sections['ENV'] = new rtEnvSection('ENV', array('env1 = ENV1', 'env2=ENV2')); + $this->sections['INI'] = new rtIniSection('INI', array('error_reporting=E_ALL | E_STRICT | E_DEPRECATED', 'assert.active = 1')); } public function testCreateInstance() @@ -55,7 +55,7 @@ class rtTestConfigurationTest extends PHPUnit_Framework_TestCase $testConfiguration = new rtTestConfiguration($config, $this->sections); $phpargs = $testConfiguration->getPhpCommandLineArguments(); - $match = preg_match("/-d \"error_reporting=E_ALL | E_STRICT | E_DEPRECATED\" -d \"assert.active=1\"/",$phpargs); + $match = preg_match("/-d \"error_reporting=E_ALL | E_STRICT | E_DEPRECATED\" -d \"assert.active=1\"/", $phpargs); $this->assertEquals(1, $match); } diff --git a/tests/testcase/rtTestDifferenceTest.php b/tests/testcase/rtTestDifferenceTest.php index 68d9212..ce471bf 100644 --- a/tests/testcase/rtTestDifferenceTest.php +++ b/tests/testcase/rtTestDifferenceTest.php @@ -7,10 +7,11 @@ class rtTestDifferenceTest extends PHPUnit_Framework_TestCase { public function testTestDifference() { - $expectSection = new rtExpectSection('EXPECT',array('Hello World')); + $expectSection = new rtExpectSection('EXPECT', array('Hello World')); $testDifference = new rtTestDifference($expectSection, 'Hello Dolly'); $difference = $testDifference->getDifference(); + $this->assertEquals('001+ Hello Dolly', $difference[0]); $this->assertEquals('001- Hello World', $difference[1]); } diff --git a/tests/testcase/rtTestExecutionTest.php b/tests/testcase/rtTestExecutionTest.php index db001a5..82592ff 100644 --- a/tests/testcase/rtTestExecutionTest.php +++ b/tests/testcase/rtTestExecutionTest.php @@ -42,7 +42,7 @@ class rtTestExecutionTest extends PHPUnit_Framework_TestCase $testFile->normaliseLineEndings(); //Create a new test case - $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(),$config); + $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(), $config); //Setup and set the local environment for the test case $testCase->executeTest($config); @@ -66,7 +66,7 @@ class rtTestExecutionTest extends PHPUnit_Framework_TestCase $testFile->normaliseLineEndings(); //Create a new test case - $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(),$config); + $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(), $config); //Setup and set the local environment for the test case $testCase->executeTest($config); @@ -93,7 +93,7 @@ class rtTestExecutionTest extends PHPUnit_Framework_TestCase $testFile->normaliseLineEndings(); //Create a new test case - $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(),$testFile->getSectionHeadings(), $config); + $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(), $config); //Setup and set the local environment for the test case $testCase->executeTest($config); @@ -120,7 +120,7 @@ class rtTestExecutionTest extends PHPUnit_Framework_TestCase $testFile->normaliseLineEndings(); //Create a new test case - $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(),$testFile->getSectionHeadings(), $config); + $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(), $config); //Setup and set the local environment for the test case $testCase->executeTest($config); diff --git a/tests/testcase/rtTestOutputWriterTest.php b/tests/testcase/rtTestOutputWriterTest.php index 04220d0..e9e65ae 100644 --- a/tests/testcase/rtTestOutputWriterTest.php +++ b/tests/testcase/rtTestOutputWriterTest.php @@ -42,7 +42,7 @@ class rtTestOutputWriterTest extends PHPUnit_Framework_TestCase $testFile->normaliseLineEndings(); //Create a new test case - $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(),$config); + $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(), $config); //Setup and set the local environment for the test case $testCase->executeTest($config); diff --git a/tests/testcase/rtTestResultsTest.php b/tests/testcase/rtTestResultsTest.php index 160a5b9..6ce5337 100644 --- a/tests/testcase/rtTestResultsTest.php +++ b/tests/testcase/rtTestResultsTest.php @@ -45,7 +45,7 @@ class rtTestResultsTest extends PHPUnit_Framework_TestCase $testFile->normaliseLineEndings(); //Create a new test case - $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(),$testFile->getSectionHeadings(), $config); + $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(), $config); //Setup and set the local environment for the test case $testCase->executeTest($config); @@ -73,7 +73,7 @@ class rtTestResultsTest extends PHPUnit_Framework_TestCase $testFile->normaliseLineEndings(); //Create a new test case - $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(),$testFile->getSectionHeadings(), $config); + $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(), $config); //Setup and set the local environment for the test case $testCase->executeTest($config); @@ -101,7 +101,7 @@ class rtTestResultsTest extends PHPUnit_Framework_TestCase $testFile->normaliseLineEndings(); //Create a new test case - $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(),$testFile->getSectionHeadings(), $config); + $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(), $config); //Setup and set the local environment for the test case $testCase->executeTest($config); @@ -129,7 +129,7 @@ class rtTestResultsTest extends PHPUnit_Framework_TestCase $testFile->normaliseLineEndings(); //Create a new test case - $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(),$config); + $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(), $config); //Setup and set the local environment for the test case $testCase->executeTest($config); @@ -160,7 +160,7 @@ class rtTestResultsTest extends PHPUnit_Framework_TestCase $testFile->normaliseLineEndings(); //Create a new test case - $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(),$config); + $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(), $config); //Setup and set the local environment for the test case $testCase->executeTest($config); @@ -189,7 +189,7 @@ class rtTestResultsTest extends PHPUnit_Framework_TestCase $testFile->normaliseLineEndings(); //Create a new test case - $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(),$config); + $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(), $config); //Setup and set the local environment for the test case $testCase->executeTest($config); @@ -217,7 +217,7 @@ class rtTestResultsTest extends PHPUnit_Framework_TestCase $testFile->normaliseLineEndings(); //Create a new test case - $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(),$config); + $testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(), $testFile->getSectionHeadings(), $config); //Setup and set the local environment for the test case $testCase->executeTest($config); @@ -244,7 +244,7 @@ class rtTestResultsTest extends PHPUnit_Framework_TestCase $testFile->doRead($testFiles[0]); $testFile->normaliseLineEndings(); - if(!$testFile->arePreConditionsMet()) { + if (!$testFile->arePreConditionsMet()) { $results = new rtTestResults(null, "borked", $testFiles[0]); diff --git a/tests/testcase/sections/configurationsections/rtArgsSectionTest.php b/tests/testcase/sections/configurationsections/rtArgsSectionTest.php index 774aaf6..90790e2 100644 --- a/tests/testcase/sections/configurationsections/rtArgsSectionTest.php +++ b/tests/testcase/sections/configurationsections/rtArgsSectionTest.php @@ -1,17 +1,16 @@ <?php + require_once 'PHPUnit/Framework.php'; require_once dirname(__FILE__) . '../../../../../src/rtAutoload.php'; - class rtArgsSectionTest extends PHPUnit_Framework_TestCase - { -public function testCreateInstance() { - $argsSection = new rtArgsSection('ARGS',array('-vvv -a value -1111 -2 -v')); - $arglist = $argsSection->getTestCommandLineArguments(); - $this->assertEquals('-- -vvv -a value -1111 -2 -v', $arglist); - } - + public function testCreateInstance() + { + $argsSection = new rtArgsSection('ARGS', array('-vvv -a value -1111 -2 -v')); + $arglist = $argsSection->getTestCommandLineArguments(); + $this->assertEquals('-- -vvv -a value -1111 -2 -v', $arglist); + } } -?> \ No newline at end of file +?> diff --git a/tests/testcase/sections/configurationsections/rtEnvSectionTest.php b/tests/testcase/sections/configurationsections/rtEnvSectionTest.php index 87a9a37..b0c3b99 100644 --- a/tests/testcase/sections/configurationsections/rtEnvSectionTest.php +++ b/tests/testcase/sections/configurationsections/rtEnvSectionTest.php @@ -1,18 +1,17 @@ <?php + require_once 'PHPUnit/Framework.php'; require_once dirname(__FILE__) . '../../../../../src/rtAutoload.php'; - class rtEnvSectionTest extends PHPUnit_Framework_TestCase - { -public function testCreateInstance() { - $envSection = new rtEnvSection('ENV',array('env1 = ENV1', 'env2=ENV2')); - $envlist = $envSection->getTestEnvironmentVariables(); - $this->assertEquals('ENV1', $envlist['env1']); - $this->assertEquals('ENV2', $envlist['env2']); - } - + public function testCreateInstance() + { + $envSection = new rtEnvSection('ENV', array('env1 = ENV1', 'env2=ENV2')); + $envlist = $envSection->getTestEnvironmentVariables(); + $this->assertEquals('ENV1', $envlist['env1']); + $this->assertEquals('ENV2', $envlist['env2']); + } } -?> \ No newline at end of file +?> diff --git a/tests/testcase/sections/configurationsections/rtIniSectionTest.php b/tests/testcase/sections/configurationsections/rtIniSectionTest.php index 97a49ca..dab304a 100644 --- a/tests/testcase/sections/configurationsections/rtIniSectionTest.php +++ b/tests/testcase/sections/configurationsections/rtIniSectionTest.php @@ -1,18 +1,17 @@ <?php + require_once 'PHPUnit/Framework.php'; require_once dirname(__FILE__) . '../../../../../src/rtAutoload.php'; - class rtIniSectionTest extends PHPUnit_Framework_TestCase { - -public function testCreateInstance() { - - $iniSection = new rtIniSection('INI',array('error_reporting=E_ALL | E_STRICT | E_DEPRECATED', 'assert.active = 1')); - $inilist = $iniSection->getCommandLineArguments(); - $this->assertEquals('error_reporting=E_ALL | E_STRICT | E_DEPRECATED', $inilist[0]); - $this->assertEquals('assert.active = 1', $inilist[1]); - } + public function testCreateInstance() + { + $iniSection = new rtIniSection('INI', array('error_reporting=E_ALL | E_STRICT | E_DEPRECATED', 'assert.active = 1')); + $inilist = $iniSection->getCommandLineArguments(); + $this->assertEquals('error_reporting=E_ALL | E_STRICT | E_DEPRECATED', $inilist[0]); + $this->assertEquals('assert.active = 1', $inilist[1]); + } } -?> \ No newline at end of file +?> diff --git a/tests/testcase/sections/executablesections/rtCleanSectionTest.php b/tests/testcase/sections/executablesections/rtCleanSectionTest.php index 6c72e56..6e6eb1b 100644 --- a/tests/testcase/sections/executablesections/rtCleanSectionTest.php +++ b/tests/testcase/sections/executablesections/rtCleanSectionTest.php @@ -1,17 +1,16 @@ <?php + require_once 'PHPUnit/Framework.php'; require_once dirname(__FILE__) . '../../../../../src/rtAutoload.php'; - class rtCleanSectionTest extends PHPUnit_Framework_TestCase - { -public function testCreateInstance() { - $cleanSection = new rtCleanSection('CLEAN',array('<?php', 'echo "hello world";', '?>')); - $code = $cleanSection->getContents(); - $this->assertEquals('<?php', $code[0]); - } - - + public function testCreateInstance() + { + $cleanSection = new rtCleanSection('CLEAN', array('<?php', 'echo "hello world";', '?>')); + $code = $cleanSection->getContents(); + + $this->assertEquals('<?php', $code[0]); + } } -?> \ No newline at end of file +?> diff --git a/tests/testcase/sections/executablesections/rtFileSectionTest.php b/tests/testcase/sections/executablesections/rtFileSectionTest.php index dc00a11..86e73ed 100644 --- a/tests/testcase/sections/executablesections/rtFileSectionTest.php +++ b/tests/testcase/sections/executablesections/rtFileSectionTest.php @@ -1,17 +1,16 @@ <?php + require_once 'PHPUnit/Framework.php'; require_once dirname(__FILE__) . '../../../../../src/rtAutoload.php'; - class rtSkipIfSectionTest extends PHPUnit_Framework_TestCase - { -public function testCreateInstance() { - $skipifSection = new rtSkipIfSection('SKIPIF',array('<?php', 'echo "hello world";', '?>')); - $code = $skipifSection->getContents(); - $this->assertEquals('<?php', $code[0]); - } - + public function testCreateInstance() + { + $skipifSection = new rtSkipIfSection('SKIPIF', array('<?php', 'echo "hello world";', '?>')); + $code = $skipifSection->getContents(); + $this->assertEquals('<?php', $code[0]); + } } -?> \ No newline at end of file +?> diff --git a/tests/testcase/sections/executablesections/rtSkipIfSectionTest.php b/tests/testcase/sections/executablesections/rtSkipIfSectionTest.php index 2b8c751..ec37dc9 100644 --- a/tests/testcase/sections/executablesections/rtSkipIfSectionTest.php +++ b/tests/testcase/sections/executablesections/rtSkipIfSectionTest.php @@ -1,17 +1,16 @@ <?php + require_once 'PHPUnit/Framework.php'; require_once dirname(__FILE__) . '../../../../../src/rtAutoload.php'; - class rtFileSectionTest extends PHPUnit_Framework_TestCase - { -public function testCreateInstance() { - $fileSection = new rtFileSection('FILE',array('<?php', 'echo "hello world";', '?>')); - $code = $fileSection->getContents(); - $this->assertEquals('<?php', $code[0]); - } - + public function testCreateInstance() + { + $fileSection = new rtFileSection('FILE', array('<?php', 'echo "hello world";', '?>')); + $code = $fileSection->getContents(); + $this->assertEquals('<?php', $code[0]); + } } -?> \ No newline at end of file +?> diff --git a/tests/testcase/sections/informationsections/rtCreditsSectionTest.php b/tests/testcase/sections/informationsections/rtCreditsSectionTest.php index 6da7aaf..dc6837f 100644 --- a/tests/testcase/sections/informationsections/rtCreditsSectionTest.php +++ b/tests/testcase/sections/informationsections/rtCreditsSectionTest.php @@ -1,19 +1,17 @@ <?php + require_once 'PHPUnit/Framework.php'; require_once dirname(__FILE__) . '../../../../../src/rtAutoload.php'; - class rtCreditsSectionTest extends PHPUnit_Framework_TestCase { - -public function testCreateInstance() { - - $creditsSection = new rtCreditsSection('CREDITS',array('Test from Fred', 'PHP London test fest')); - $creditslist = $creditsSection->getContents(); - $this->assertEquals('Test from Fred', $creditslist[0]); - $this->assertEquals('PHP London test fest', $creditslist[1]); - - } + public function testCreateInstance() + { + $creditsSection = new rtCreditsSection('CREDITS', array('Test from Fred', 'PHP London test fest')); + $creditslist = $creditsSection->getContents(); + $this->assertEquals('Test from Fred', $creditslist[0]); + $this->assertEquals('PHP London test fest', $creditslist[1]); + } } -?> \ No newline at end of file +?> diff --git a/tests/testcase/sections/informationsections/rtTestHeaderSectionTest.php b/tests/testcase/sections/informationsections/rtTestHeaderSectionTest.php index 551da61..a10881e 100644 --- a/tests/testcase/sections/informationsections/rtTestHeaderSectionTest.php +++ b/tests/testcase/sections/informationsections/rtTestHeaderSectionTest.php @@ -1,18 +1,16 @@ <?php + require_once 'PHPUnit/Framework.php'; require_once dirname(__FILE__) . '../../../../../src/rtAutoload.php'; - class rtTestHeaderSectionTest extends PHPUnit_Framework_TestCase { - -public function testCreateInstance() { - - $headerSection = new rtTestHeaderSection('TEST',array('a test to test something')); - $header = $headerSection->getHeader(); - $this->assertEquals('a test to test something', $header); - - } + public function testCreateInstance() + { + $headerSection = new rtTestHeaderSection('TEST', array('a test to test something')); + $header = $headerSection->getHeader(); + $this->assertEquals('a test to test something', $header); + } } -?> \ No newline at end of file +?> diff --git a/tests/testcase/sections/informationsections/rtXfailSectionTest.php b/tests/testcase/sections/informationsections/rtXfailSectionTest.php index 6c0bc0e..ba5f2f0 100644 --- a/tests/testcase/sections/informationsections/rtXfailSectionTest.php +++ b/tests/testcase/sections/informationsections/rtXfailSectionTest.php @@ -1,17 +1,16 @@ <?php + require_once 'PHPUnit/Framework.php'; require_once dirname(__FILE__) . '../../../../../src/rtAutoload.php'; - class rtXfailSectionTest extends PHPUnit_Framework_TestCase { - -public function testCreateInstance() { - - $xfailSection = new rtXfailSection('XFAIL',array('Bug number 12345')); - $xfail = $xfailSection->getReason(); - $this->assertEquals('Bug number 12345', $xfail); - - } + public function testCreateInstance() + { + $xfailSection = new rtXfailSection('XFAIL', array('Bug number 12345')); + $xfail = $xfailSection->getReason(); + + $this->assertEquals('Bug number 12345', $xfail); + } } -?> \ No newline at end of file +?> diff --git a/tests/testcase/sections/outputsections/rtExpectFSectionTest.php b/tests/testcase/sections/outputsections/rtExpectFSectionTest.php index f86e362..a72c7ef 100644 --- a/tests/testcase/sections/outputsections/rtExpectFSectionTest.php +++ b/tests/testcase/sections/outputsections/rtExpectFSectionTest.php @@ -1,83 +1,96 @@ <?php + require_once 'PHPUnit/Framework.php'; require_once dirname(__FILE__) . '../../../../../src/rtAutoload.php'; - class rtExpectFSectionTest extends PHPUnit_Framework_TestCase { - public function testCreatePattern() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello World')); - $pattern = $expectFSection->getPattern(); - $this->assertEquals('Hello World', $pattern); - } - - public function testPercentE() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %e')); - $pattern = $expectFSection->getPattern(); - $this->assertEquals("Hello \\/", $pattern); - } - - public function testPercentS() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %s')); - $pattern = $expectFSection->getPattern(); - $this->assertEquals('Hello [^\r\n]+', $pattern); - } - - - - public function testPercentA() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %a')); - $pattern = $expectFSection->getPattern(); - $this->assertEquals('Hello .+', $pattern); - } - - - public function testPercentW() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %w')); - $pattern = $expectFSection->getPattern(); - $this->assertEquals('Hello \s*', $pattern); - } - - - public function testPercentI() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %i')); - $pattern = $expectFSection->getPattern(); - $this->assertEquals('Hello [+-]?\d+', $pattern); - } - - - public function testPercentD() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %d')); - $pattern = $expectFSection->getPattern(); - $this->assertEquals('Hello \d+', $pattern); - } - - - public function testPercentX() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %x')); - $pattern = $expectFSection->getPattern(); - $this->assertEquals('Hello [0-9a-fA-F]+', $pattern); - } - - - public function testPercentF() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %f')); - $pattern = $expectFSection->getPattern(); - $this->assertEquals('Hello [+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?', $pattern); - } - - - public function testPercentC() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %c')); - $pattern = $expectFSection->getPattern(); - $this->assertEquals('Hello .', $pattern); - } - - public function testCompare() { - $expectFSection = new rtExpectFSection('EXPECTF',array('Hello %s') ); - $result = $expectFSection->compare('Hello World'); - $this->assertTrue($result); - } + public function testCreatePattern() + { + $expectFSection = new rtExpectFSection('EXPECTF', array('Hello World')); + $pattern = $expectFSection->getPattern(); + + $this->assertEquals('Hello World', $pattern); + } + + public function testPercentE() + { + $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %e')); + $pattern = $expectFSection->getPattern(); + + $this->assertEquals("Hello \\/", $pattern); + } + + public function testPercentS() + { + $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %s')); + $pattern = $expectFSection->getPattern(); + + $this->assertEquals('Hello [^\r\n]+', $pattern); + } + + public function testPercentA() + { + $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %a')); + $pattern = $expectFSection->getPattern(); + + $this->assertEquals('Hello .+', $pattern); + } + + public function testPercentW() + { + $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %w')); + $pattern = $expectFSection->getPattern(); + + $this->assertEquals('Hello \s*', $pattern); + } + + public function testPercentI() + { + $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %i')); + $pattern = $expectFSection->getPattern(); + + $this->assertEquals('Hello [+-]?\d+', $pattern); + } + + public function testPercentD() + { + $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %d')); + $pattern = $expectFSection->getPattern(); + + $this->assertEquals('Hello \d+', $pattern); + } + + public function testPercentX() + { + $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %x')); + $pattern = $expectFSection->getPattern(); + + $this->assertEquals('Hello [0-9a-fA-F]+', $pattern); + } + + public function testPercentF() + { + $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %f')); + $pattern = $expectFSection->getPattern(); + + $this->assertEquals('Hello [+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?', $pattern); + } + + public function testPercentC() + { + $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %c')); + $pattern = $expectFSection->getPattern(); + + $this->assertEquals('Hello .', $pattern); + } + + public function testCompare() + { + $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %s') ); + $result = $expectFSection->compare('Hello World'); + $this->assertTrue($result); + } } -?> \ No newline at end of file +?> diff --git a/tests/testcase/sections/outputsections/rtExpectRegexSectionTest.php b/tests/testcase/sections/outputsections/rtExpectRegexSectionTest.php index 52fff2a..f077462 100644 --- a/tests/testcase/sections/outputsections/rtExpectRegexSectionTest.php +++ b/tests/testcase/sections/outputsections/rtExpectRegexSectionTest.php @@ -1,21 +1,24 @@ <?php + require_once 'PHPUnit/Framework.php'; require_once dirname(__FILE__) . '../../../../../src/rtAutoload.php'; - class rtExpectRegexSectionTest extends PHPUnit_Framework_TestCase { - public function testCreateObject() { - $expectRegexSection = new rtExpectRegexSection('EXPECTREGEX',array('Hello \w{5}') ); - $pattern = $expectRegexSection->getPattern(); - $this->assertEquals("Hello \w{5}", $pattern); - } - - public function testCompare() { - $expectRegexSection = new rtExpectRegexSection('EXPECTREGEX',array('Hello \w{5}') ); - $result = $expectRegexSection->compare('Hello World'); - $this->assertTrue($result); - } + public function testCreateObject() + { + $expectRegexSection = new rtExpectRegexSection('EXPECTREGEX', array('Hello \w{5}')); + $pattern = $expectRegexSection->getPattern(); + + $this->assertEquals("Hello \w{5}", $pattern); + } + + public function testCompare() + { + $expectRegexSection = new rtExpectRegexSection('EXPECTREGEX', array('Hello \w{5}')); + $result = $expectRegexSection->compare('Hello World'); + $this->assertTrue($result); + } } -?> \ No newline at end of file +?> diff --git a/tests/testcase/sections/outputsections/rtExpectSectionTest.php b/tests/testcase/sections/outputsections/rtExpectSectionTest.php index 5829a54..19e49b2 100644 --- a/tests/testcase/sections/outputsections/rtExpectSectionTest.php +++ b/tests/testcase/sections/outputsections/rtExpectSectionTest.php @@ -1,35 +1,40 @@ <?php + require_once 'PHPUnit/Framework.php'; require_once dirname(__FILE__) . '../../../../../src/rtAutoload.php'; - class rtExpectSectionTest extends PHPUnit_Framework_TestCase { -public function testCreatePattern() { - $expectSection = new rtExpectSection('EXPECT',array('Hello World')); - $pattern = $expectSection->getPattern(); - $this->assertEquals('Hello World', $pattern); - } - - - public function testCreateTwolinePattern() { - $expectSection = new rtExpectSection('EXPECT',array('Hello World', 'Hello again')); - - $pattern = $expectSection->getPattern(); - $this->assertEquals("Hello World\nHello again", $pattern); - } - - public function testCreateTwolinePatternWithr() { - $expectSection = new rtExpectSection('EXPECT',array("Hello World\r", 'Hello again')); - $pattern = $expectSection->getPattern(); - $this->assertEquals("Hello World\nHello again", $pattern); - } - - public function testCompare() { - $expectSection = new rtExpectSection('EXPECT',array('Hello World') ); - $result = $expectSection->compare('Hello World'); - $this->assertTrue($result); - } + public function testCreatePattern() { + $expectSection = new rtExpectSection('EXPECT', array('Hello World')); + $pattern = $expectSection->getPattern(); + + $this->assertEquals('Hello World', $pattern); + } + + + public function testCreateTwolinePattern() + { + $expectSection = new rtExpectSection('EXPECT', array('Hello World', 'Hello again')); + $pattern = $expectSection->getPattern(); + + $this->assertEquals("Hello World\nHello again", $pattern); + } + + public function testCreateTwolinePatternWithr() + { + $expectSection = new rtExpectSection('EXPECT', array("Hello World\r", 'Hello again')); + $pattern = $expectSection->getPattern(); + + $this->assertEquals("Hello World\nHello again", $pattern); + } + + public function testCompare() + { + $expectSection = new rtExpectSection('EXPECT', array('Hello World') ); + $result = $expectSection->compare('Hello World'); + $this->assertTrue($result); + } } -?> \ No newline at end of file +?> diff --git a/tests/testcase/sections/rtSectionTest.php b/tests/testcase/sections/rtSectionTest.php index 8c80db7..68058ae 100644 --- a/tests/testcase/sections/rtSectionTest.php +++ b/tests/testcase/sections/rtSectionTest.php @@ -5,16 +5,18 @@ require_once dirname(__FILE__) . '../../../../src/rtAutoload.php'; class rtSectionTest extends PHPUnit_Framework_TestCase { - public function testGetInstance() { - $expectFSection = rtSection::getInstance('EXPECTF', array('Hello World')); - $this->assertEquals('rtExpectFSection', get_class($expectFSection)); - } + public function testGetInstance() + { + $expectFSection = rtSection::getInstance('EXPECTF', array('Hello World')); + $this->assertEquals('rtExpectFSection', get_class($expectFSection)); + } - /** - * @expectedException RuntimeException - */ - public function testGetInstanceThrowsExceptionOnUnknownSection() { - rtSection::getInstance('NONSENSE', array()); - } + /** + * @expectedException RuntimeException + */ + public function testGetInstanceThrowsExceptionOnUnknownSection() + { + rtSection::getInstance('NONSENSE', array()); + } } ?>
« previous php.qa (#66529) next »