Index: tests/Zend/Log/Writer/DbTest.php =================================================================== --- tests/Zend/Log/Writer/DbTest.php (revision 14615) +++ tests/Zend/Log/Writer/DbTest.php (working copy) @@ -39,11 +39,11 @@ public function setUp() { $this->tableName = 'db-table-name'; - + $this->db = new Zend_Log_Writer_DbTest_MockDbAdapter(); $this->writer = new Zend_Log_Writer_Db($this->db, $this->tableName); } - + public function testFormattingIsNotSupported() { try { @@ -54,7 +54,7 @@ $this->assertRegExp('/does not support formatting/i', $e->getMessage()); } } - + public function testWriteWithDefaults() { // log to the mock db adapter @@ -68,9 +68,9 @@ $this->assertEquals(1, count($this->db->calls['insert'])); // ...with the correct table and binds for the database - $binds = array('message' => $fields['message'], + $binds = array('message' => $fields['message'], 'priority' => $fields['priority']); - $this->assertEquals(array($this->tableName, $binds), + $this->assertEquals(array($this->tableName, $binds), $this->db->calls['insert'][0]); } @@ -79,20 +79,20 @@ $this->writer = new Zend_Log_Writer_Db($this->db, $this->tableName, array('new-message-field' => 'message', 'new-message-field' => 'priority')); - + // log to the mock db adapter $message = 'message-to-log'; $priority = 2; $this->writer->write(array('message' => $message, 'priority' => $priority)); - + // insert should be called once... $this->assertContains('insert', array_keys($this->db->calls)); $this->assertEquals(1, count($this->db->calls['insert'])); - + // ...with the correct table and binds for the database - $binds = array('new-message-field' => $message, + $binds = array('new-message-field' => $message, 'new-message-field' => $priority); - $this->assertEquals(array($this->tableName, $binds), + $this->assertEquals(array($this->tableName, $binds), $this->db->calls['insert'][0]); } @@ -106,7 +106,7 @@ $this->fail(); } catch (Exception $e) { $this->assertType('Zend_Log_Exception', $e); - $this->assertRegExp('/shutdown$/i', $e->getMessage()); + $this->assertEquals('Database adapter is null', $e->getMessage()); } } } @@ -116,9 +116,9 @@ { public $calls = array(); - public function __call($method, $params) - { - $this->calls[$method][] = $params; + public function __call($method, $params) + { + $this->calls[$method][] = $params; } } \ No newline at end of file