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