Created
July 30, 2012 20:30
-
-
Save jubianchi/3209900 to your computer and use it in GitHub Desktop.
atoum test
This file contains 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 | |
use \mageekguy\atoum; | |
$stdOutWriter = new atoum\writers\std\out(); | |
$cliReport = new atoum\reports\realtime\cli(); | |
$cliReport->addWriter($stdOutWriter); | |
$xunit = new atoum\reports\asynchronous\xunit(); | |
$writer = new atoum\writers\file('atoum.xml'); | |
$xunit->addWriter($writer); | |
$runner->addReport($cliReport); | |
$runner->addReport($xunit); |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<testsuites name="atoum testsuite"> | |
<testsuite name="computer" package="tests\unit" tests="1" failures="0" errors="0" time="0.00084114074707031"> | |
<testcase name="testCompute" time="0.00084114074707031" file="/Users/jubianchi/repositories/fake/tests/unit/computer.php" classname="tests\unit\computer"/> | |
</testsuite> | |
</testsuites> |
This file contains 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 computer { | |
public function compute($a, $b) { | |
return $a + $b; | |
} | |
} | |
This file contains 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 | |
namespace tests\unit; | |
use mageekguy\atoum\test; | |
use computer as testedClass; | |
require_once __DIR__ . '/../../atoum/classes/test.php'; | |
require_once __DIR__ . '/../../computer.php'; | |
class computer extends test { | |
public function testCompute() { | |
$this | |
->if($object = new testedClass()) | |
->then | |
->integer($object->compute(1, 2))->isEqualTo(3); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mageekguy/atoum@8ff37c4