Skip to content
Permalink
Browse files

MDL-40935 phpunit: Remove assertLegacyEventName() since get_legacy_ev…

…entname() is public now
  • Loading branch information...
ankitagarwal committed Aug 6, 2013
1 parent 2244600 commit 320aee339cf1cbb590ad3532445c3fe821f2e3ab
Showing with 1 addition and 24 deletions.
  1. +0 −15 lib/phpunit/classes/advanced_testcase.php
  2. +0 −8 lib/phpunit/classes/event_mock.php
  3. +1 −1 lib/tests/accesslib_test.php
@@ -338,21 +338,6 @@ public function assertEventLegacyLogData($expected, \core\event\base $event, $me
$this->assertEquals($expected, $legacydata, $message);
}
/**
* Assert that an event legacy name is equal to the expected value.
*
* @param mixed $expected expected name.
* @param \core\event\base $event the event object.
* @param string $message
* @return void
*/
public function assertEventLegacyName($expected, \core\event\base $event, $message = '') {
$legacydata = phpunit_event_mock::testable_get_legacy_eventname($event);
if ($message === '') {
$message = 'Event legacy name does not match expected value.';
}
$this->assertEquals($expected, $legacydata, $message);
}
/**
* Starts message redirection.
@@ -35,14 +35,6 @@
*/
abstract class phpunit_event_mock extends \core\event\base {
/**
* Returns the log data of the event.
* @return array
*/
public static function testable_get_legacy_eventname($event) {
return $event->get_legacy_eventname();
}
/**
* Returns the log data of the event.
* @return array
@@ -486,7 +486,7 @@ public function test_role_assign() {
$this->assertEquals($raid, $event->other['id']);
$this->assertSame('', $event->other['component']);
$this->assertEquals(0, $event->other['itemid']);
$this->assertEventLegacyName('role_assigned', $event);
$this->assertSame('role_assigned', $event::get_legacy_eventname());
}
/**

0 comments on commit 320aee3

Please sign in to comment.
You can’t perform that action at this time.