com phpruntests: fix tests: tests/testcase/rtTestConfigurationTest.php tests/testcase/rtTestDifferenceTest.php
tests/testcase/sections/outputsections/rtExpectFSectionTest.php tests/testcase/sections/outputsections/rtExpectHeadersSectionTest.php
tests/testcase/sections/outputsections/rtExpectRegexSectionTest.php tests/testcase/sections/outputsections/rtExpectSectionTest.php
| From: | David Soria Parra | Date: | Sun, 17 May 2009 12:55:15 +0000 |
| Subject: | com phpruntests: fix tests: tests/testcase/rtTestConfigurationTest.php tests/testcase/rtTestDifferenceTest.php tests/testcase/sections/outputsections/rtExpectFSectionTest.php tests/testcase/sections/outputsections/rtExpectHeadersSectionTest.php tests/testcase/sections/outputsections/rtExpectRegexSectionTest.php tests/testcase/sections/outputsections/rtExpectSectionTest.php |
||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-66448@lists.php.net to get a copy of this message | ||
Commit: edc7cc71f610f3336bbfc92ff79881fb5dfedfc3
Author: Zoe Slattery <zoe@php.net> Sun, 17 May 2009 12:55:15 +0000
Parents: d9a13c6e20b7effa147b637cbd10c9b550cdd7aa
Branches: master
Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=edc7cc71f610f3336bbfc92ff79881fb5dfedfc3
Log:
fix tests
Changed paths:
M tests/testcase/rtTestConfigurationTest.php
M tests/testcase/rtTestDifferenceTest.php
M tests/testcase/sections/outputsections/rtExpectFSectionTest.php
M tests/testcase/sections/outputsections/rtExpectHeadersSectionTest.php
M tests/testcase/sections/outputsections/rtExpectRegexSectionTest.php
M tests/testcase/sections/outputsections/rtExpectSectionTest..php
diff --git a/tests/testcase/rtTestConfigurationTest.php b/tests/testcase/rtTestConfigurationTest.php index 70b8743..c99ff06 100644 --- a/tests/testcase/rtTestConfigurationTest.php +++ b/tests/testcase/rtTestConfigurationTest.php @@ -11,10 +11,10 @@ class rtTestConfigurationTest extends PHPUnit_Framework_TestCase { $this->php = $this->php = trim(shell_exec("which php")); - $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['FILE'] = new rtFileSection('FILE', array('blah')); + $this->sections['ARGS'] = rtArgsSection::getInstance('ARGS', array('-vvv -a value -1111 -2 -v')); + $this->sections['ENV'] = rtEnvSection::getInstance('ENV', array('env1 = ENV1', 'env2=ENV2')); + $this->sections['INI'] = rtIniSection::getInstance('INI', array('error_reporting=E_ALL | E_STRICT | E_DEPRECATED', 'assert.active = 1')); + $this->sections['FILE'] = rtFileSection::getInstance('FILE', array('blah')); } diff --git a/tests/testcase/rtTestDifferenceTest.php b/tests/testcase/rtTestDifferenceTest.php index ce471bf..458d076 100644 --- a/tests/testcase/rtTestDifferenceTest.php +++ b/tests/testcase/rtTestDifferenceTest.php @@ -7,7 +7,7 @@ class rtTestDifferenceTest extends PHPUnit_Framework_TestCase { public function testTestDifference() { - $expectSection = new rtExpectSection('EXPECT', array('Hello World')); + $expectSection = rtExpectSection::getInstance('EXPECT', array('Hello World')); $testDifference = new rtTestDifference($expectSection, 'Hello Dolly'); $difference = $testDifference->getDifference(); diff --git a/tests/testcase/sections/outputsections/rtExpectFSectionTest.php b/tests/testcase/sections/outputsections/rtExpectFSectionTest.php index a776b1b..99b8822 100644 --- a/tests/testcase/sections/outputsections/rtExpectFSectionTest.php +++ b/tests/testcase/sections/outputsections/rtExpectFSectionTest.php @@ -7,7 +7,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase { public function testCreatePattern() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello World')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello World')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello World', $pattern); @@ -15,7 +15,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentE() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %e')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %e')); $pattern = $expectFSection->getPattern(); $this->assertEquals("Hello \\/", $pattern); @@ -23,7 +23,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentS() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %s')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %s')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello [^\r\n]+', $pattern); @@ -31,7 +31,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentA() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %a')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %a')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello .+', $pattern); @@ -39,7 +39,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentW() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %w')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %w')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello \s*', $pattern); @@ -47,7 +47,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentI() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %i')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %i')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello [+-]?\d+', $pattern); @@ -55,7 +55,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentD() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %d')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %d')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello \d+', $pattern); @@ -63,7 +63,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentX() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %x')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %x')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello [0-9a-fA-F]+', $pattern); @@ -71,7 +71,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentF() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %f')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %f')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello [+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?', $pattern); @@ -79,7 +79,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentR() { - $expectFSection = new rtExpectFSection('EXPECTF', array('%unicode|string%(18) "%r\0%rMyClass%r\0%rpri_value%r\0%r"')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('%unicode|string%(18) "%r\0%rMyClass%r\0%rpri_value%r\0%r"')); $pattern = $expectFSection->getPattern(); $this->assertEquals('string\(18\) "(\0)MyClass(\0)pri_value(\0)"', $pattern); @@ -87,7 +87,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentC() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %c')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %c')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello .', $pattern); @@ -95,7 +95,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testCompare() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %s') ); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %s') ); $result = $expectFSection->compare('Hello World'); $this->assertTrue($result); diff --git a/tests/testcase/sections/outputsections/rtExpectHeadersSectionTest.php b/tests/testcase/sections/outputsections/rtExpectHeadersSectionTest.php index b2b66d4..8686bb1 100644 --- a/tests/testcase/sections/outputsections/rtExpectHeadersSectionTest.php +++ b/tests/testcase/sections/outputsections/rtExpectHeadersSectionTest.php @@ -6,7 +6,7 @@ require_once dirname(__FILE__) . '../../../../../src/rtAutoload.php'; class rtExpectHeadersSectionTest extends PHPUnit_Framework_TestCase { public function testCreatePattern() { - $expectSection = new rtExpectHeadersSection('EXPECTHEADERS', array('abc:def', 'ghi:jkl')); + $expectSection = rtExpectHeadersSection::getInstance('EXPECTHEADERS', array('abc:def', 'ghi:jkl')); $pattern = $expectSection->getPattern(); $this->assertEquals('def', $pattern['abc']); @@ -14,7 +14,7 @@ class rtExpectHeadersSectionTest extends PHPUnit_Framework_TestCase } public function testCreatePattern2() { - $expectSection = new rtExpectHeadersSection('EXPECTHEADERS', array("abc:def\r\n", "ghi:jkl:fred")); + $expectSection = rtExpectHeadersSection::getInstance('EXPECTHEADERS', array("abc:def\r\n", "ghi:jkl:fred")); $pattern = $expectSection->getPattern(); $this->assertEquals('def', $pattern['abc']); @@ -22,14 +22,14 @@ class rtExpectHeadersSectionTest extends PHPUnit_Framework_TestCase } public function testCompare() { - $expectSection = new rtExpectHeadersSection('EXPECTHEADERS', array("abc:def\r\n", "ghi:jkl:fred")); + $expectSection = rtExpectHeadersSection::getInstance('EXPECTHEADERS', array("abc:def\r\n", "ghi:jkl:fred")); $test = $expectSection->compare("ghi:jkl:fred\nabc: def"); $this->assertTrue($test); } public function testCompare2() { - $expectSection = new rtExpectHeadersSection('EXPECTHEADERS', array("abc:def\r\n", "ghi:jkl:fred")); + $expectSection = rtExpectHeadersSection::getInstance('EXPECTHEADERS', array("abc:def\r\n", "ghi:jkl:fred")); $test = $expectSection->compare("ghi:jkl\r\nabcd: def\r\n"); $this->assertFalse($test); diff --git a/tests/testcase/sections/outputsections/rtExpectRegexSectionTest.php b/tests/testcase/sections/outputsections/rtExpectRegexSectionTest.php index f077462..aa2e47e 100644 --- a/tests/testcase/sections/outputsections/rtExpectRegexSectionTest.php +++ b/tests/testcase/sections/outputsections/rtExpectRegexSectionTest.php @@ -7,7 +7,7 @@ class rtExpectRegexSectionTest extends PHPUnit_Framework_TestCase { public function testCreateObject() { - $expectRegexSection = new rtExpectRegexSection('EXPECTREGEX', array('Hello \w{5}')); + $expectRegexSection = rtExpectRegexSection::getInstance('EXPECTREGEX', array('Hello \w{5}')); $pattern = $expectRegexSection->getPattern(); $this->assertEquals("Hello \w{5}", $pattern); @@ -15,7 +15,7 @@ class rtExpectRegexSectionTest extends PHPUnit_Framework_TestCase public function testCompare() { - $expectRegexSection = new rtExpectRegexSection('EXPECTREGEX', array('Hello \w{5}')); + $expectRegexSection = rtExpectRegexSection::getInstance('EXPECTREGEX', array('Hello \w{5}')); $result = $expectRegexSection->compare('Hello World'); $this->assertTrue($result); diff --git a/tests/testcase/sections/outputsections/rtExpectSectionTest.php b/tests/testcase/sections/outputsections/rtExpectSectionTest.php index 19e49b2..5242f8a 100644 --- a/tests/testcase/sections/outputsections/rtExpectSectionTest.php +++ b/tests/testcase/sections/outputsections/rtExpectSectionTest.php @@ -6,7 +6,7 @@ require_once dirname(__FILE__) . '../../../../../src/rtAutoload.php'; class rtExpectSectionTest extends PHPUnit_Framework_TestCase { public function testCreatePattern() { - $expectSection = new rtExpectSection('EXPECT', array('Hello World')); + $expectSection = rtExpectSection::getInstance('EXPECT', array('Hello World')); $pattern = $expectSection->getPattern(); $this->assertEquals('Hello World', $pattern); @@ -15,7 +15,7 @@ class rtExpectSectionTest extends PHPUnit_Framework_TestCase public function testCreateTwolinePattern() { - $expectSection = new rtExpectSection('EXPECT', array('Hello World', 'Hello again')); + $expectSection = rtExpectSection::getInstance('EXPECT', array('Hello World', 'Hello again')); $pattern = $expectSection->getPattern(); $this->assertEquals("Hello World\nHello again", $pattern); @@ -23,7 +23,7 @@ class rtExpectSectionTest extends PHPUnit_Framework_TestCase public function testCreateTwolinePatternWithr() { - $expectSection = new rtExpectSection('EXPECT', array("Hello World\r", 'Hello again')); + $expectSection = rtExpectSection::getInstance('EXPECT', array("Hello World\r", 'Hello again')); $pattern = $expectSection->getPattern(); $this->assertEquals("Hello World\nHello again", $pattern); @@ -31,7 +31,7 @@ class rtExpectSectionTest extends PHPUnit_Framework_TestCase public function testCompare() { - $expectSection = new rtExpectSection('EXPECT', array('Hello World') ); + $expectSection = rtExpectSection::getInstance('EXPECT', array('Hello World') ); $result = $expectSection->compare('Hello World'); $this->assertTrue($result);
diff --git a/tests/testcase/rtTestConfigurationTest.php b/tests/testcase/rtTestConfigurationTest.php index 70b8743..c99ff06 100644 --- a/tests/testcase/rtTestConfigurationTest.php +++ b/tests/testcase/rtTestConfigurationTest.php @@ -11,10 +11,10 @@ class rtTestConfigurationTest extends PHPUnit_Framework_TestCase { $this->php = $this->php = trim(shell_exec("which php")); - $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['FILE'] = new rtFileSection('FILE', array('blah')); + $this->sections['ARGS'] = rtArgsSection::getInstance('ARGS', array('-vvv -a value -1111 -2 -v')); + $this->sections['ENV'] = rtEnvSection::getInstance('ENV', array('env1 = ENV1', 'env2=ENV2')); + $this->sections['INI'] = rtIniSection::getInstance('INI', array('error_reporting=E_ALL | E_STRICT | E_DEPRECATED', 'assert.active = 1')); + $this->sections['FILE'] = rtFileSection::getInstance('FILE', array('blah')); } diff --git a/tests/testcase/rtTestDifferenceTest.php b/tests/testcase/rtTestDifferenceTest.php index ce471bf..458d076 100644 --- a/tests/testcase/rtTestDifferenceTest.php +++ b/tests/testcase/rtTestDifferenceTest.php @@ -7,7 +7,7 @@ class rtTestDifferenceTest extends PHPUnit_Framework_TestCase { public function testTestDifference() { - $expectSection = new rtExpectSection('EXPECT', array('Hello World')); + $expectSection = rtExpectSection::getInstance('EXPECT', array('Hello World')); $testDifference = new rtTestDifference($expectSection, 'Hello Dolly'); $difference = $testDifference->getDifference(); diff --git a/tests/testcase/sections/outputsections/rtExpectFSectionTest.php b/tests/testcase/sections/outputsections/rtExpectFSectionTest.php index a776b1b..99b8822 100644 --- a/tests/testcase/sections/outputsections/rtExpectFSectionTest.php +++ b/tests/testcase/sections/outputsections/rtExpectFSectionTest.php @@ -7,7 +7,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase { public function testCreatePattern() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello World')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello World')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello World', $pattern); @@ -15,7 +15,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentE() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %e')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %e')); $pattern = $expectFSection->getPattern(); $this->assertEquals("Hello \\/", $pattern); @@ -23,7 +23,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentS() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %s')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %s')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello [^\r\n]+', $pattern); @@ -31,7 +31,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentA() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %a')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %a')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello .+', $pattern); @@ -39,7 +39,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentW() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %w')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %w')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello \s*', $pattern); @@ -47,7 +47,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentI() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %i')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %i')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello [+-]?\d+', $pattern); @@ -55,7 +55,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentD() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %d')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %d')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello \d+', $pattern); @@ -63,7 +63,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentX() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %x')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %x')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello [0-9a-fA-F]+', $pattern); @@ -71,7 +71,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentF() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %f')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %f')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello [+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?', $pattern); @@ -79,7 +79,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentR() { - $expectFSection = new rtExpectFSection('EXPECTF', array('%unicode|string%(18) "%r\0%rMyClass%r\0%rpri_value%r\0%r"')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('%unicode|string%(18) "%r\0%rMyClass%r\0%rpri_value%r\0%r"')); $pattern = $expectFSection->getPattern(); $this->assertEquals('string\(18\) "(\0)MyClass(\0)pri_value(\0)"', $pattern); @@ -87,7 +87,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testPercentC() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %c')); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %c')); $pattern = $expectFSection->getPattern(); $this->assertEquals('Hello .', $pattern); @@ -95,7 +95,7 @@ class rtExpectFSectionTest extends PHPUnit_Framework_TestCase public function testCompare() { - $expectFSection = new rtExpectFSection('EXPECTF', array('Hello %s') ); + $expectFSection = rtExpectFSection::getInstance('EXPECTF', array('Hello %s') ); $result = $expectFSection->compare('Hello World'); $this->assertTrue($result); diff --git a/tests/testcase/sections/outputsections/rtExpectHeadersSectionTest.php b/tests/testcase/sections/outputsections/rtExpectHeadersSectionTest.php index b2b66d4..8686bb1 100644 --- a/tests/testcase/sections/outputsections/rtExpectHeadersSectionTest.php +++ b/tests/testcase/sections/outputsections/rtExpectHeadersSectionTest.php @@ -6,7 +6,7 @@ require_once dirname(__FILE__) . '../../../../../src/rtAutoload.php'; class rtExpectHeadersSectionTest extends PHPUnit_Framework_TestCase { public function testCreatePattern() { - $expectSection = new rtExpectHeadersSection('EXPECTHEADERS', array('abc:def', 'ghi:jkl')); + $expectSection = rtExpectHeadersSection::getInstance('EXPECTHEADERS', array('abc:def', 'ghi:jkl')); $pattern = $expectSection->getPattern(); $this->assertEquals('def', $pattern['abc']); @@ -14,7 +14,7 @@ class rtExpectHeadersSectionTest extends PHPUnit_Framework_TestCase } public function testCreatePattern2() { - $expectSection = new rtExpectHeadersSection('EXPECTHEADERS', array("abc:def\r\n", "ghi:jkl:fred")); + $expectSection = rtExpectHeadersSection::getInstance('EXPECTHEADERS', array("abc:def\r\n", "ghi:jkl:fred")); $pattern = $expectSection->getPattern(); $this->assertEquals('def', $pattern['abc']); @@ -22,14 +22,14 @@ class rtExpectHeadersSectionTest extends PHPUnit_Framework_TestCase } public function testCompare() { - $expectSection = new rtExpectHeadersSection('EXPECTHEADERS', array("abc:def\r\n", "ghi:jkl:fred")); + $expectSection = rtExpectHeadersSection::getInstance('EXPECTHEADERS', array("abc:def\r\n", "ghi:jkl:fred")); $test = $expectSection->compare("ghi:jkl:fred\nabc: def"); $this->assertTrue($test); } public function testCompare2() { - $expectSection = new rtExpectHeadersSection('EXPECTHEADERS', array("abc:def\r\n", "ghi:jkl:fred")); + $expectSection = rtExpectHeadersSection::getInstance('EXPECTHEADERS', array("abc:def\r\n", "ghi:jkl:fred")); $test = $expectSection->compare("ghi:jkl\r\nabcd: def\r\n"); $this->assertFalse($test); diff --git a/tests/testcase/sections/outputsections/rtExpectRegexSectionTest.php b/tests/testcase/sections/outputsections/rtExpectRegexSectionTest.php index f077462..aa2e47e 100644 --- a/tests/testcase/sections/outputsections/rtExpectRegexSectionTest.php +++ b/tests/testcase/sections/outputsections/rtExpectRegexSectionTest.php @@ -7,7 +7,7 @@ class rtExpectRegexSectionTest extends PHPUnit_Framework_TestCase { public function testCreateObject() { - $expectRegexSection = new rtExpectRegexSection('EXPECTREGEX', array('Hello \w{5}')); + $expectRegexSection = rtExpectRegexSection::getInstance('EXPECTREGEX', array('Hello \w{5}')); $pattern = $expectRegexSection->getPattern(); $this->assertEquals("Hello \w{5}", $pattern); @@ -15,7 +15,7 @@ class rtExpectRegexSectionTest extends PHPUnit_Framework_TestCase public function testCompare() { - $expectRegexSection = new rtExpectRegexSection('EXPECTREGEX', array('Hello \w{5}')); + $expectRegexSection = rtExpectRegexSection::getInstance('EXPECTREGEX', array('Hello \w{5}')); $result = $expectRegexSection->compare('Hello World'); $this->assertTrue($result); diff --git a/tests/testcase/sections/outputsections/rtExpectSectionTest.php b/tests/testcase/sections/outputsections/rtExpectSectionTest.php index 19e49b2..5242f8a 100644 --- a/tests/testcase/sections/outputsections/rtExpectSectionTest.php +++ b/tests/testcase/sections/outputsections/rtExpectSectionTest.php @@ -6,7 +6,7 @@ require_once dirname(__FILE__) . '../../../../../src/rtAutoload.php'; class rtExpectSectionTest extends PHPUnit_Framework_TestCase { public function testCreatePattern() { - $expectSection = new rtExpectSection('EXPECT', array('Hello World')); + $expectSection = rtExpectSection::getInstance('EXPECT', array('Hello World')); $pattern = $expectSection->getPattern(); $this->assertEquals('Hello World', $pattern); @@ -15,7 +15,7 @@ class rtExpectSectionTest extends PHPUnit_Framework_TestCase public function testCreateTwolinePattern() { - $expectSection = new rtExpectSection('EXPECT', array('Hello World', 'Hello again')); + $expectSection = rtExpectSection::getInstance('EXPECT', array('Hello World', 'Hello again')); $pattern = $expectSection->getPattern(); $this->assertEquals("Hello World\nHello again", $pattern); @@ -23,7 +23,7 @@ class rtExpectSectionTest extends PHPUnit_Framework_TestCase public function testCreateTwolinePatternWithr() { - $expectSection = new rtExpectSection('EXPECT', array("Hello World\r", 'Hello again')); + $expectSection = rtExpectSection::getInstance('EXPECT', array("Hello World\r", 'Hello again')); $pattern = $expectSection->getPattern(); $this->assertEquals("Hello World\nHello again", $pattern); @@ -31,7 +31,7 @@ class rtExpectSectionTest extends PHPUnit_Framework_TestCase public function testCompare() { - $expectSection = new rtExpectSection('EXPECT', array('Hello World') ); + $expectSection = rtExpectSection::getInstance('EXPECT', array('Hello World') ); $result = $expectSection->compare('Hello World'); $this->assertTrue($result);