Ejemplo n.º 1
0
 public function testReturnResultFromQueryBuilder()
 {
     $stub = \Mockery::mock('Entity\\Posts');
     MockEntityController::mock('post', $stub);
     $entityName = \PHPUnit_Framework_Assert::readAttribute($this->query->setQuery('post'), 'entityName');
     $this->assertEquals('Entity\\Posts', $entityName);
 }
Ejemplo n.º 2
0
 public function setUp()
 {
     $anyEntity = \Mockery::mock('alias:Entity\\AnyEntity');
     MockEntityController::mock('entityKey', $anyEntity);
     $controller = $this->getMockBuilder('\\DataBase\\Command\\Command')->disableOriginalConstructor()->getMock();
     $controller->method('entity')->willReturn($anyEntity);
     $this->uniqueValidator = new UniqueValidator($controller);
 }