public function testICanGetTestSuitesWithMultipleTests()
{
// tests
$filename = $this->directory . 'ExampleTest1.php';
$content = '<?php
namespace vendor\\project\\tests\\units;
require_once "ExampleSrc1.php";
use \\mageekguy\\atoum;
use \\vendor\\project;
class helloWorld1 extends atoum\\test {
public function testSay() {
$this->string("1")->isEqualTo("2")
;
}
}
';
file_put_contents($filename, $content);
$filename = $this->directory . 'ExampleTest2.php';
$content = '<?php
namespace vendor\\project\\tests\\units;
require_once "ExampleSrc2.php";
use \\mageekguy\\atoum;
use \\vendor\\project;
class helloWorld2 extends atoum\\test {
public function testSay() {
$this->string("1")->isEqualTo("1")
;
}
}
';
file_put_contents($filename, $content);
// sources
$filename = $this->directory . 'ExampleSrc1.php';
$content = '<?php
namespace vendor\\project;
class helloWorld1 {
public function say() {
return "Hello World!";
}
public function foo() {
return "Hello foo";
}
}
';
file_put_contents($filename, $content);
$filename = $this->directory . 'ExampleSrc2.php';
$content = '<?php
namespace vendor\\project;
class helloWorld2 {
public function say() {
return "Hello World!";
}
public function foo() {
return "Hello foo";
}
}
';
file_put_contents($filename, $content);
$runner = new AtoumAdapter($this->binary, $this->directory);
$logFile = tempnam(sys_get_temp_dir(), 'unit-test');
$runner->run(null, array(), $logFile);
$collection = $runner->getSuiteResult($logFile);
$this->assertInstanceOf('\\Hal\\MutaTesting\\Test\\UnitCollectionInterface', $collection);
$this->assertEquals(2, sizeof($collection->all()));
$unit = $collection->getByFile($this->directory . 'ExampleTest1.php');
$this->assertInstanceOf('\\Hal\\MutaTesting\\Test\\UnitInterface', $unit);
}