Created
May 29, 2012 22:45
-
-
Save monsat/2831229 to your computer and use it in GitHub Desktop.
PHPUnit Class
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 | |
# tests/SampleTest.php | |
require __DIR__ . '/../lib/Sample.php'; | |
class SampleTest extends PHPUnit_Framework_TestCase { | |
public function testAnyMethod() { | |
$this->object = new Sample(); | |
$this->assertEquals('正しい値', $this->Sample->anyMethod(), 'テストが失敗されたときに表示されるコメント'); | |
} | |
} |
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 | |
# tests/SampleTest.php | |
require __DIR__ . '/../lib/Sample.php'; | |
class SampleTest extends PHPUnit_Framework_TestCase { | |
public function setUp() { | |
$this->object = new Sample(); | |
} | |
public function tearDown() { | |
unset($this->object); | |
} | |
public function testAnyMethod() { | |
$this->assertEquals('正しい値', $this->Sample->anyMethod(), 'テストが失敗されたときに表示されるコメント'); | |
} | |
} |
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 | |
# tests/SampleTest.php | |
require __DIR__ . '/../lib/Sample.php'; | |
class SampleTest extends PHPUnit_Framework_TestCase { | |
public function setUp() { | |
$this->object = new Sample(); | |
} | |
public function tearDown() { | |
unset($this->object); | |
} | |
/** | |
* @group regression | |
* @group bug2204 | |
*/ | |
public function testAnyMethod() { | |
$this->assertEquals('正しい値', $this->Sample->anyMethod(), 'テストが失敗されたときに表示されるコメント'); | |
} | |
} | |
// $ phpunit --group bug2204 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment