コード例 #1
0
 /**
  * @covers PitchBlade\Storage\Database\PDOStatement::__construct
  * @covers PitchBlade\Storage\Database\PDOStatement::execute
  */
 public function testExecuteWithParams($bound_input_params = null)
 {
     $dbConnection = new PDO($this->dsn, $this->username, $this->password, $this->driverOptions, $this->getMock('\\PitchBlade\\Logging\\Timeable'));
     $stmt = $dbConnection->prepare("INSERT INTO test_table (name) VALUES (:name)");
     $this->assertTrue($stmt->execute(['name' => 'withparams']));
     $stmt = $dbConnection->query('SELECT count(*) FROM test_table');
     $this->assertSame('1', $stmt->fetch()->count);
 }