Ejemplo n.º 1
0
 /**
  * @covers PDOK\Connector::setAttribute
  */
 public function testConnectedSetAttribute()
 {
     $c = new Connector('sqlite::memory:');
     $c->connect();
     $this->assertEquals(0, $c->getAttribute(\PDO::ATTR_CASE));
     $c->setAttribute(\PDO::ATTR_CASE, \PDO::CASE_UPPER);
     $this->assertEquals(\PDO::CASE_UPPER, $c->getAttribute(\PDO::ATTR_CASE));
 }
Ejemplo n.º 2
0
 public function testAttributesSurviveDisconnection()
 {
     $expected = \PDO::CASE_UPPER;
     $conn = new \PDOK\Connector('sqlite::memory:');
     $conn->setAttribute(\PDO::ATTR_CASE, $expected);
     $this->assertEquals($expected, $conn->getAttribute(\PDO::ATTR_CASE));
     $conn->connect();
     $this->assertEquals($expected, $conn->getAttribute(\PDO::ATTR_CASE));
     $conn->disconnect();
     $this->assertEquals($expected, $conn->getAttribute(\PDO::ATTR_CASE));
     $conn->connect();
     $this->assertEquals($expected, $conn->getAttribute(\PDO::ATTR_CASE));
 }