Beispiel #1
0
 public function before()
 {
     $this->adapter = mockery('SimDAL_Persistence_AdapterInterface');
     $this->unitOfWork = new SimDAL_UnitOfWork($this->adapter, $this->mapper);
     SimDAL_Repository::setDefaultAdapter($this->adapter);
     SimDAL_Repository::setDefaultMapper($this->mapper);
 }
Beispiel #2
0
 public function before()
 {
     $this->storage = array('projects' => array('1' => array('id' => 1, 'name' => 'Project', 'description' => 'This is a test Project'), '2' => array('id' => 2, 'name' => 'Project2', 'description' => 'This is a test Project')));
     $this->adapter = mockery('SimDAL_Persistence_AdapterInterface');
     $this->unitOfWork = mockery('SimDAL_UnitOfWork');
     $this->repo = new TestDomain_ProjectRepository($this->adapter, $this->mapper, $this->unitOfWork);
 }
Beispiel #3
0
 public function testShouldReturnTrueOnValidationByDefaultIfNoExpectationsSet()
 {
     $mock = mockery('MockeryTest_EmptyClass');
     try {
         $this->assertTrue($mock->mockery_verify());
     } catch (Exception $e) {
         $this->fail('Mock object checking threw an Exception reading: ' . $e->getMessage());
     }
 }
Beispiel #4
0
 public function testDoubleMockingSameClassOccursWithoutError()
 {
     $mock = mockery('MockeryTest_EmptyClass');
     $mock2 = mockery('MockeryTest_EmptyClass');
     $this->assertTrue($mock !== $mock2);
 }
 public function testShouldReturnSelfInstanceFromAndthrowTerm()
 {
     $mock = mockery('MockeryTest_Album');
     $object = $mock->shouldReceive('getName')->andThrow('Exception');
     $this->assertTrue($object instanceof Mockery_Expectation);
 }