public function testGetRepository() { $model = new Waf_Model(); $model->register(); $this->entityResolver->setEntityName('Bla'); $this->assertType('Waf_Model_Repository', $this->entityResolver->getRepository()); }
public function testGetModelDefaultsToRegistered() { $property = $this->getMockForAbstractClass('Waf_Model_Mapper_Property_PropertyAbstract', array('Foo', null)); $model = new Waf_Model(); $model->register(); $this->assertSame($model, $property->getModel()); }
public function testMagicCallProxiesToEntityManager() { $entityManager = new Waf_Zend_Controller_Action_Helper_EntityManagerTest_TestEntityManager(); $model = new Waf_Model(); $model->register(); $model->setEntityManager($entityManager); $this->assertEquals('sapperdedosiofoo', $this->entityManagerHelper->test('foo')); }
public function testMagicCallProxiesToRepositoryMethod() { $model = new Waf_Model(); $model->register(); $model->setEntityManager(new Waf_Zend_Controller_Action_Helper_RepositoryTest_TestEntityManager()); $request = new Zend_Controller_Request_Simple(); $request->setControllerName('test'); $request->setModuleName('default'); Zend_Controller_Front::getInstance()->setRequest($request); $this->assertType('Waf_Zend_Controller_Action_Helper_RepositoryTest_TestRepository', $this->repositoryHelper->testMagicCall()); }
public function testGetRepository() { $model = new Waf_Model(); $model->register(); $this->assertType('Waf_Model_Repository', $this->repositoryHelper->repository('test')); }