Example #1
0
 public function testAddCustomPlaceholder_setCustomsPlaceholdersSetCustomAdapter()
 {
     $db = new Database(new DSN('mysql:'));
     $myPlaceholderOne = Helper::getMockCustomPlaceholder('?x');
     $db->addCustomPlaceholder($myPlaceholderOne);
     $myAdapter = Helper::getMockCustomAdapter();
     $db->setAdapter($myAdapter);
     $myPlaceholderTwo = Helper::getMockCustomPlaceholder('?y');
     $db->addCustomPlaceholder($myPlaceholderTwo);
     $this->assertEquals($myAdapter, $db->getAdapter());
     $placeholders = $db->getPlaceholders();
     foreach ($db->getPlaceholders()->getAllPlaceholdersAsArray() as $placeholder) {
         $this->assertEquals($myAdapter, $placeholder->getQuotePerformer());
     }
     $this->assertEquals('f#_nadxy', $placeholders->getAllPlaceholdersAsString());
 }