Skip to content
This repository has been archived by the owner on May 27, 2023. It is now read-only.

Bootstrap autoloader patch #237

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/code/community/EcomDev/PHPUnit/Test/Case/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ public static function getGroupedClassMockBuilder(PHPUnit_Framework_TestCase $te
public static function setUp()
{
self::app()->resetDispatchedEvents();
self::$originalStore = Mage::app()->getStore()->getCode();
}

/**
Expand Down
6 changes: 3 additions & 3 deletions app/code/community/EcomDev/PHPUnit/Test/Listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,16 @@ public function endTest(PHPUnit_Framework_Test $test, $time)
));

if ($test instanceof PHPUnit_Framework_TestCase) {
EcomDev_PHPUnit_Helper::tearDown();
EcomDev_PHPUnit_Test_Case_Util::tearDown();

EcomDev_PHPUnit_Test_Case_Util::getFixture(get_class($test))
->setScope(EcomDev_PHPUnit_Model_FixtureInterface::SCOPE_LOCAL)
->discard(); // Clear applied fixture

if (EcomDev_PHPUnit_Test_Case_Util::getExpectation(get_class($test))->isLoaded()) {
EcomDev_PHPUnit_Test_Case_Util::getExpectation(get_class($test))->discard();
}

EcomDev_PHPUnit_Test_Case_Util::tearDown();
EcomDev_PHPUnit_Helper::tearDown();
}

Mage::dispatchEvent('phpunit_test_end_after', array(
Expand Down
7 changes: 6 additions & 1 deletion app/code/community/EcomDev/PHPUnit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
)
);

@include $filePath . '.php';
$classFile = $filePath . '.php';
if (stream_resolve_include_path($classFile)) {
return include $classFile;
} else {
return false;
}
});
}