Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add test.

  • Loading branch information...
commit 206defa482d45a471d55c3b477e2d44c2f382d7f 1 parent 767f031
@sebastianbergmann authored
View
40 PHPUnit/Tests/TextUI/template-methods.phpt
@@ -0,0 +1,40 @@
+--TEST--
+phpunit TemplateMethodsTest ../_files/TemplateMethodsTest.php
+--FILE--
+<?php
+$_SERVER['argv'][1] = '--no-configuration';
+$_SERVER['argv'][2] = 'TemplateMethodsTest';
+$_SERVER['argv'][3] = dirname(dirname(__FILE__)) . '/_files/TemplateMethodsTest.php';
+
+require_once dirname(dirname(dirname(__FILE__))) . '/TextUI/Command.php';
+PHPUnit_TextUI_Command::main();
+?>
+--EXPECTF--
+PHPUnit %s by Sebastian Bergmann.
+
+TemplateMethodsTest::setUpBeforeClass
+TemplateMethodsTest::setUp
+TemplateMethodsTest::assertPreConditions
+TemplateMethodsTest::testOne
+TemplateMethodsTest::assertPostConditions
+TemplateMethodsTest::tearDown
+.TemplateMethodsTest::setUp
+TemplateMethodsTest::assertPreConditions
+TemplateMethodsTest::testTwo
+TemplateMethodsTest::tearDown
+TemplateMethodsTest::onNotSuccessfulTest
+FTemplateMethodsTest::tearDownAfterClass
+
+
+Time: %i %s, Memory: %sMb
+
+There was 1 failure:
+
+1) TemplateMethodsTest::testTwo
+Failed asserting that <boolean:false> is true.
+
+%s/TemplateMethodsTest.php:28
+%s/template-methods.php:7
+
+FAILURES!
+Tests: 2, Assertions: 2, Failures: 1.
View
52 PHPUnit/Tests/_files/TemplateMethodsTest.php
@@ -0,0 +1,52 @@
+<?php
+class TemplateMethodsTest extends PHPUnit_Framework_TestCase
+{
+ public static function setUpBeforeClass()
+ {
+ print __METHOD__ . "\n";
+ }
+
+ protected function setUp()
+ {
+ print __METHOD__ . "\n";
+ }
+
+ protected function assertPreConditions()
+ {
+ print __METHOD__ . "\n";
+ }
+
+ public function testOne()
+ {
+ print __METHOD__ . "\n";
+ $this->assertTrue(TRUE);
+ }
+
+ public function testTwo()
+ {
+ print __METHOD__ . "\n";
+ $this->assertTrue(FALSE);
+ }
+
+ protected function assertPostConditions()
+ {
+ print __METHOD__ . "\n";
+ }
+
+ protected function tearDown()
+ {
+ print __METHOD__ . "\n";
+ }
+
+ public static function tearDownAfterClass()
+ {
+ print __METHOD__ . "\n";
+ }
+
+ protected function onNotSuccessfulTest(Exception $e)
+ {
+ print __METHOD__ . "\n";
+ throw $e;
+ }
+}
+?>
Please sign in to comment.
Something went wrong with that request. Please try again.