Exemplo n.º 1
0
 public function testReturnsSameModelAsSetManually()
 {
     $model = $this->getMockBuilder('\\Alchemy\\Model\\Facade')->disableOriginalConstructor()->getMock();
     Factory::getInstance()->setModel('User', $model);
     $expected = $model;
     $actual = Factory::getInstance()->getModel('User');
     $this->assertSame($expected, $actual);
 }
 protected function forceErrorFromModel($modelName)
 {
     $nullModel = ModelFactory::getInstance()->getModel('Error');
     ModelFactory::getInstance()->setModel($modelName, $nullModel);
 }
Exemplo n.º 3
0
 /**
  * @param  string               $modelName
  * @return \Alchemy\ModelFacade
  */
 public function getModel($modelName)
 {
     return Factory::getInstance()->getModel($modelName);
 }