Example #1
0
 public function testGetConnection()
 {
     $pdoStub = $this->getMock("TestPDO");
     $pdoStub->method("prepare")->will($this->returnCallback([$this, 'pdoPrepareDelete']));
     $database = new Database($pdoStub);
     $this->assertInstanceOf("PDO", $database->getConnection());
 }
Example #2
0
 /**
  * finds all entities in this repository
  *
  * @return array
  */
 public function findAll()
 {
     $stmt = $this->database->getConnection()->prepare($this->createSelect());
     return $this->buildEntities($stmt);
 }