public function testUpdate() { $testEntity = UserProfileTest::createTestUserProfile(); self::$entityManager->persist($testEntity); self::$entityManager->flush(); $this->assertNotEquals('fubar', $testEntity->getName()); $testEntity->setName('fubar'); UserProfileService::update(); $entities = self::$entityManager->createQuery('SELECT e FROM Rexmac\\Zyndax\\Entity\\UserProfile e')->execute(); $this->assertEquals('fubar', $entities[0]->getName()); }
public function setUp() { $fc = FrontController::getInstance(); $fc->resetInstance(); $fc->setControllerDirectory(dirname(__FILE__), 'default'); #\Zend_Registry::set('acl', AclTest::createTestAcl()); $user = UserTest::createTestUser(); $userProfile = UserProfileTest::createTestUserProfile(); $user->setProfile($userProfile); $acl = $this->_getCleanMock('Rexmac\\Zyndax\\Acl\\Acl'); $acl->expects($this->once())->method('getUser')->will($this->returnValue($user)); Zend_Registry::set('acl', $acl); }