Example #1
0
 /**
  * @covers ::delete
  * @dataProvider dbProvider
  * @param YoPdo $yo_pdo
  */
 public function testDeleteRecord(YoPdo $yo_pdo)
 {
     $rows = $this->sample_table_creator->getSampleRows();
     $table_name = $this->sample_table_creator->createPopulatedTable($yo_pdo, $rows);
     $expected = $rows;
     unset($expected[2]);
     $yo_pdo->delete($table_name, "id = :id", array('id' => 2));
     $this->result_asserter->assertResults($yo_pdo, $table_name, $expected);
 }
Example #2
0
 /**
  * @covers ::begin
  * @covers ::rollbackAll
  * @dataProvider dbProvider
  * @param YoPdo $yo_pdo
  */
 public function testRollbackAllEndsAllNames(YoPdo $yo_pdo)
 {
     $rows = $this->sample_table_creator->getSampleRows();
     $table_name = $this->sample_table_creator->createTable($yo_pdo);
     $yo_pdo->transaction()->begin('outer');
     $yo_pdo->transaction()->begin('inner');
     $yo_pdo->insert($table_name, $rows[1]);
     $yo_pdo->transaction()->rollbackAll();
     $this->assertUnknownTransactionNameException($yo_pdo, 'inner');
     $this->assertUnknownTransactionNameException($yo_pdo, 'outer');
 }