From f3e65a200d825280cde4341da4fe1251f9dbf1ad Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sun, 17 Jan 2010 21:34:24 -0500 Subject: [PATCH] rework directories --- classes/PostFixtures.inc | 6 +++++- test/PostFixturesTest.php | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/classes/PostFixtures.inc b/classes/PostFixtures.inc index 36d5473..920661d 100644 --- a/classes/PostFixtures.inc +++ b/classes/PostFixtures.inc @@ -103,7 +103,7 @@ class PostFixtures { */ // @codeCoverageIgnoreStart function render_admin() { - + $fixtures = $this->find_fixtures(); include(dirname(__FILE__) . '/partials/admin.inc'); } @@ -116,6 +116,10 @@ class PostFixtures { $this->_find_fixtures_recurse($this->wpcontent_path()); + foreach ($this->fixtures as &$path) { + $path = str_replace($this->wpcontent_path() . '/', '', $path); + } + return $this->fixtures; } diff --git a/test/PostFixturesTest.php b/test/PostFixturesTest.php index 92e5d2b..d6c6e64 100644 --- a/test/PostFixturesTest.php +++ b/test/PostFixturesTest.php @@ -350,11 +350,11 @@ class PostFixturesTest extends PHPUnit_Framework_TestCase { } $pf = $this->getMock('PostFixtures', array('wpcontent_path')); - $pf->expects($this->once())->method('wpcontent_path')->will($this->returnValue(vfsStream::url('root'))); + $pf->expects($this->any())->method('wpcontent_path')->will($this->returnValue(vfsStream::url('root'))); $this->assertEquals(array( - vfsStream::url('root/dir/fixtures/test.json'), - vfsStream::url('root/dir/fixtures/test.inc'), + 'dir/fixtures/test.json', + 'dir/fixtures/test.inc', ), $pf->find_fixtures()); } }