public function testAuthors() { $author1 = new stdClass(); $author2 = new stdClass(); $fakeAuthors = array($author2, $author1); $this->_mockWpFunctions->shouldReceive('get_users')->once()->with(array('who' => 'author'))->andReturn($fakeAuthors); $actual = $this->_sut->getAuthors(); $this->assertSame($fakeAuthors, $actual); }
public function onWpUser(tubepress_api_event_EventInterface $event) { $result = array(); $authors = $this->_resourceRepository->getAuthors(); foreach ($authors as $user) { $loginName = $this->_deIntegerizeLoginName($user->user_login); $display = $user->display_name; $result[$loginName] = $display; } $this->_sortArrayAndSetAsSubject($result, $event); }