Skip to content

Commit

Permalink
Updating the CoreTracker tests to compare the loaded output, too (and…
Browse files Browse the repository at this point in the history
… make the report list cleaner)
  • Loading branch information
zyxist committed Jul 10, 2011
1 parent 24a916f commit b119ac2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/TestSuite/CoreTrackerTest.php
Expand Up @@ -82,11 +82,15 @@ public function testCreatingTheInitialFile()
$loader = new GenericLoader(\vfsStream::url(''));
$loader->addNamespace('Foo');

ob_start();

$tracker = new CoreTracker($loader, './cache/core.txt');
$tracker->register();
$tracker->loadClass('Foo\\Bar');
$tracker->unregister();
unset($tracker);

$this->assertEquals('FOO\BAR.PHP', ob_get_clean());

$result = unserialize(file_get_contents('./cache/core.txt'));
$this->assertEquals(array('Foo\\Bar'), $result);
Expand All @@ -112,6 +116,7 @@ public function testUpdatingTheFile()

unlink('./cache/core.txt');

ob_start();
$loader = new GenericLoader(\vfsStream::url(''));
$loader->addNamespace('Foo');

Expand All @@ -131,6 +136,8 @@ public function testUpdatingTheFile()
$tracker->loadClass('Foo\\Goo');
$tracker->unregister();
unset($tracker);

$this->assertEquals('FOO\BAR.PHPFOO\JOE.PHPFOO\BAR.PHPFOO\GOO.PHP', ob_get_clean());

$result = unserialize(file_get_contents('./cache/core.txt'));
$this->assertEquals(array('Foo\\Bar'), $result);
Expand Down

0 comments on commit b119ac2

Please sign in to comment.