MINOR Fix tests to check against dynamic FRAMEWORK_DIR and $project

instead of hardcoding these checks
This commit is contained in:
Sean Harvey 2012-04-14 13:25:40 +12:00
parent 6405c44bc2
commit c45027d247

View File

@ -52,7 +52,8 @@ class DeprecationTest extends SapphireTest {
function testNonMatchingModuleNotifcationVersionDoesntAffectNotice() {
Deprecation::notification_version('1.0.0');
Deprecation::notification_version('3.0.0', 'mysite');
global $project;
Deprecation::notification_version('3.0.0', $project);
$this->callThatOriginatesFromFramework();
}
@ -61,12 +62,12 @@ class DeprecationTest extends SapphireTest {
*/
function testMatchingModuleNotifcationVersionAffectsNotice() {
Deprecation::notification_version('1.0.0');
Deprecation::notification_version('3.0.0', 'framework');
Deprecation::notification_version('3.0.0', FRAMEWORK_DIR);
$this->callThatOriginatesFromFramework();
}
protected function callThatOriginatesFromFramework() {
$this->assertEquals(DeprecationTest_Deprecation::get_module(), 'framework');
$this->assertEquals(DeprecationTest_Deprecation::get_module(), FRAMEWORK_DIR);
Deprecation::notice('2.0', 'Deprecation test passed');
}