Permalink
Browse files

Added tests for ChromePhp

  • Loading branch information...
1 parent cc795d5 commit 8036b52726fe6df14313a0815e8effe02e3e420b @waltertamboer waltertamboer committed Aug 2, 2012
Showing with 26 additions and 34 deletions.
  1. +2 −2 tests/Zend/Log/TestAsset/MockChromePhp.php
  2. +24 −32 tests/Zend/Log/Writer/ChromePhpTest.php
@@ -1,9 +1,9 @@
<?php
namespace ZendTest\Log\TestAsset;
-use Zend\Log\Writer\FirePhp\FirePhpInterface;
+use Zend\Log\Writer\ChromePhp\ChromePhpInterface;
-class MockFirePhp implements FirePhpInterface
+class MockChromePhp implements ChromePhpInterface
{
public $calls = array();
@@ -21,9 +21,9 @@
namespace ZendTest\Log\Writer;
-use ZendTest\Log\TestAsset\MockFirePhp;
-use Zend\Log\Writer\FirePhp;
-use Zend\Log\Writer\FirePhp\FirePhpInterface;
+use ZendTest\Log\TestAsset\MockChromePhp;
+use Zend\Log\Writer\ChromePhp;
+use Zend\Log\Writer\ChromePhp\ChromePhpInterface;
use Zend\Log\Logger;
/**
@@ -34,58 +34,50 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
* @group Zend_Log
*/
-class FirePhpTest extends \PHPUnit_Framework_TestCase
+class ChromePhpTest extends \PHPUnit_Framework_TestCase
{
- protected $firephp;
+ protected $chromephp;
public function setUp()
{
- $this->firephp = new MockFirePhp();
+ $this->chromephp = new MockChromePhp();
}
- /**
- * Test get FirePhp
- */
- public function testGetFirePhp()
+
+ public function testGetChromePhp()
{
- $writer = new FirePhp($this->firephp);
- $this->assertTrue($writer->getFirePhp() instanceof FirePhpInterface);
+ $writer = new ChromePhp($this->chromephp);
+ $this->assertTrue($writer->getChromePhp() instanceof ChromePhpInterface);
}
- /**
- * Test set firephp
- */
- public function testSetFirePhp()
+
+ public function testSetChromePhp()
{
- $writer = new FirePhp($this->firephp);
- $firephp2 = new MockFirePhp();
+ $writer = new ChromePhp($this->chromephp);
+ $chromephp2 = new MockChromePhp();
- $writer->setFirePhp($firephp2);
- $this->assertTrue($writer->getFirePhp() instanceof FirePhpInterface);
- $this->assertEquals($firephp2, $writer->getFirePhp());
+ $writer->setChromePhp($chromephp2);
+ $this->assertTrue($writer->getChromePhp() instanceof ChromePhpInterface);
+ $this->assertEquals($chromephp2, $writer->getChromePhp());
}
- /**
- * Test write
- */
+
public function testWrite()
{
- $writer = new FirePhp($this->firephp);
+ $writer = new ChromePhp($this->chromephp);
$writer->write(array(
'message' => 'my msg',
'priority' => Logger::DEBUG
));
- $this->assertEquals('my msg', $this->firephp->calls['trace'][0]);
+ $this->assertEquals('my msg', $this->chromephp->calls['trace'][0]);
}
- /**
- * Test write with FirePhp disabled
- */
+
public function testWriteDisabled()
{
- $firephp = new MockFirePhp(false);
- $writer = new FirePhp($firephp);
+ $chromephp = new MockChromePhp(false);
+ $writer = new ChromePhp($chromephp);
$writer->write(array(
'message' => 'my msg',
'priority' => Logger::DEBUG
));
- $this->assertTrue(empty($this->firephp->calls));
+ $this->assertTrue(empty($this->chromephp->calls));
}
}

0 comments on commit 8036b52

Please sign in to comment.