Created
December 28, 2011 13:09
-
-
Save suin/1527890 to your computer and use it in GitHub Desktop.
PHPUnitで定数のテストをするときは@runInSeparateProcessで別プロセスに ref: http://qiita.com/items/1476
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ConstantTest extends PHPUnit_Framework_TestCase | |
{ | |
/** | |
* @runInSeparateProcess | |
*/ | |
public function testConstant1() | |
{ | |
define('THIS_IS_CONSTANT', 'foo'); | |
$this->assertSame('foo', THIS_IS_CONSTANT); | |
} | |
/** | |
* @runInSeparateProcess | |
*/ | |
public function testConstant2() | |
{ | |
define('THIS_IS_CONSTANT', 'bar'); | |
$this->assertSame('bar', THIS_IS_CONSTANT); | |
} | |
/** | |
* @runInSeparateProcess | |
*/ | |
public function testConstant3() | |
{ | |
define('THIS_IS_CONSTANT', 'baz'); | |
$this->assertSame('baz', THIS_IS_CONSTANT); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PHPUnit 3.6.3 by Sebastian Bergmann. | |
... | |
Time: 0 seconds, Memory: 4.75Mb | |
OK (3 tests, 3 assertions) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment