Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/7476'
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed May 4, 2015
2 parents 64f974b + 0c5c31a commit 3de1e33
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion test/Formatter/XmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function testHtmlSpecialCharsInMessageGetEscapedForValidXml()
$line = $f->format(array('message' => '&key1=value1&key2=value2', 'priority' => 42));

$this->assertContains("&", $line);
$this->assertTrue(substr_count($line, "&") == 2);
$this->assertEquals(2, substr_count($line, "&"));
}

/**
Expand Down
14 changes: 7 additions & 7 deletions test/LoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ public function testSetWriters()
$writers = $this->logger->getWriters();
$this->assertInstanceOf('Zend\Stdlib\SplPriorityQueue', $writers);
$writer = $writers->extract();
$this->assertTrue($writer instanceof \Zend\Log\Writer\Noop);
$this->assertInstanceOf('Zend\Log\Writer\Noop', $writer);
$writer = $writers->extract();
$this->assertTrue($writer instanceof \Zend\Log\Writer\Mock);
$this->assertInstanceOf('Zend\Log\Writer\Mock', $writer);
}

public function testAddWriterWithPriority()
Expand All @@ -120,9 +120,9 @@ public function testAddWriterWithPriority()

$this->assertInstanceOf('Zend\Stdlib\SplPriorityQueue', $writers);
$writer = $writers->extract();
$this->assertTrue($writer instanceof \Zend\Log\Writer\Noop);
$this->assertInstanceOf('Zend\Log\Writer\Noop', $writer);
$writer = $writers->extract();
$this->assertTrue($writer instanceof \Zend\Log\Writer\Mock);
$this->assertInstanceOf('Zend\Log\Writer\Mock', $writer);
}

public function testAddWithSamePriority()
Expand All @@ -135,9 +135,9 @@ public function testAddWithSamePriority()

$this->assertInstanceOf('Zend\Stdlib\SplPriorityQueue', $writers);
$writer = $writers->extract();
$this->assertTrue($writer instanceof \Zend\Log\Writer\Mock);
$this->assertInstanceOf('Zend\Log\Writer\Mock', $writer);
$writer = $writers->extract();
$this->assertTrue($writer instanceof \Zend\Log\Writer\Noop);
$this->assertInstanceOf('Zend\Log\Writer\Noop', $writer);
}

public function testLogging()
Expand Down Expand Up @@ -260,7 +260,7 @@ public function testRegisterErrorHandler()

$previous = Logger::registerErrorHandler($this->logger);
$this->assertNotNull($previous);
$this->assertTrue(false !== $previous);
$this->assertNotFalse($previous);

// check for single error handler instance
$this->assertFalse(Logger::registerErrorHandler($this->logger));
Expand Down
6 changes: 3 additions & 3 deletions test/Writer/AbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ public function testAddFilter()
public function testAddMockFilterByName()
{
$instance = $this->_writer->addFilter('mock');
$this->assertTrue($instance instanceof ConcreteWriter);
$this->assertInstanceOf('ZendTest\Log\TestAsset\ConcreteWriter', $instance);
}

public function testAddRegexFilterWithParamsByName()
{
$instance = $this->_writer->addFilter('regex', array( 'regex' => '/mess/' ));
$this->assertTrue($instance instanceof ConcreteWriter);
$this->assertInstanceOf('ZendTest\Log\TestAsset\ConcreteWriter', $instance);
}

/**
Expand All @@ -61,7 +61,7 @@ public function testFluentInterface()
$instance = $this->_writer->addFilter(1)
->setFormatter(new SimpleFormatter());

$this->assertTrue($instance instanceof ConcreteWriter);
$this->assertInstanceOf('ZendTest\Log\TestAsset\ConcreteWriter', $instance);
}

public function testConvertErrorsToException()
Expand Down
8 changes: 4 additions & 4 deletions test/Writer/ChromePhpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function setUp()
public function testGetChromePhp()
{
$writer = new ChromePhp($this->chromephp);
$this->assertTrue($writer->getChromePhp() instanceof ChromePhpInterface);
$this->assertInstanceOf('Zend\Log\Writer\ChromePhp\ChromePhpInterface', $writer->getChromePhp());
}

public function testSetChromePhp()
Expand All @@ -40,7 +40,7 @@ public function testSetChromePhp()
$chromephp2 = new MockChromePhp();

$writer->setChromePhp($chromephp2);
$this->assertTrue($writer->getChromePhp() instanceof ChromePhpInterface);
$this->assertInstanceOf('Zend\Log\Writer\ChromePhp\ChromePhpInterface', $writer->getChromePhp());
$this->assertEquals($chromephp2, $writer->getChromePhp());
}

Expand All @@ -62,7 +62,7 @@ public function testWriteDisabled()
'message' => 'my msg',
'priority' => Logger::DEBUG
));
$this->assertTrue(empty($this->chromephp->calls));
$this->assertEmpty($this->chromephp->calls);
}

public function testConstructWithOptions()
Expand All @@ -74,7 +74,7 @@ public function testConstructWithOptions()
'formatter' => $formatter,
'instance' => $this->chromephp,
));
$this->assertTrue($writer->getChromePhp() instanceof ChromePhpInterface);
$this->assertInstanceOf('Zend\Log\Writer\ChromePhp\ChromePhpInterface', $writer->getChromePhp());
$this->assertAttributeInstanceOf('Zend\Log\Formatter\ChromePhp', 'formatter', $writer);

$filters = self::readAttribute($writer, 'filters');
Expand Down
14 changes: 6 additions & 8 deletions test/Writer/DbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,9 @@ public function testMapEventIntoColumnMustReturnScalarValues()
$data = $method->invoke($this->writer, $event, $columnMap);

foreach ($data as $field => $value) {
$this->assertTrue(is_scalar($value), sprintf(
'Value of column "%s" should be scalar, %s given',
$field,
gettype($value)
$this->assertInternalType('scalar', $value, sprintf(
'Value of column "%s" should be scalar',
$field
));
}
}
Expand Down Expand Up @@ -370,10 +369,9 @@ public function testEventIntoColumnMustReturnScalarValues()
$data = $method->invoke($this->writer, $event);

foreach ($data as $field => $value) {
$this->assertTrue(is_scalar($value), sprintf(
'Value of column "%s" should be scalar, %s given',
$field,
gettype($value)
$this->assertInternalType('scalar', $value, sprintf(
'Value of column "%s" should be scalar',
$field
));
}
}
Expand Down
8 changes: 4 additions & 4 deletions test/Writer/FirePhpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function setUp()
public function testGetFirePhp()
{
$writer = new FirePhp($this->firephp);
$this->assertTrue($writer->getFirePhp() instanceof FirePhpInterface);
$this->assertInstanceOf('Zend\Log\Writer\FirePhp\FirePhpInterface', $writer->getFirePhp());
}
/**
* Test set firephp
Expand All @@ -44,7 +44,7 @@ public function testSetFirePhp()
$firephp2 = new MockFirePhp();

$writer->setFirePhp($firephp2);
$this->assertTrue($writer->getFirePhp() instanceof FirePhpInterface);
$this->assertInstanceOf('Zend\Log\Writer\FirePhp\FirePhpInterface', $writer->getFirePhp());
$this->assertEquals($firephp2, $writer->getFirePhp());
}
/**
Expand All @@ -70,7 +70,7 @@ public function testWriteDisabled()
'message' => 'my msg',
'priority' => Logger::DEBUG
));
$this->assertTrue(empty($this->firephp->calls));
$this->assertEmpty($this->firephp->calls);
}

public function testConstructWithOptions()
Expand All @@ -82,7 +82,7 @@ public function testConstructWithOptions()
'formatter' => $formatter,
'instance' => $this->firephp,
));
$this->assertTrue($writer->getFirePhp() instanceof FirePhpInterface);
$this->assertInstanceOf('Zend\Log\Writer\FirePhp\FirePhpInterface', $writer->getFirePhp());
$this->assertAttributeInstanceOf('Zend\Log\Formatter\FirePhp', 'formatter', $writer);

$filters = self::readAttribute($writer, 'filters');
Expand Down
2 changes: 1 addition & 1 deletion test/Writer/SyslogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testFluentInterface()
$instance = $writer->setFacility(LOG_USER)
->setApplicationName('my_app');

$this->assertTrue($instance instanceof SyslogWriter);
$this->assertInstanceOf('Zend\Log\Writer\Syslog', $instance);
}

/**
Expand Down

0 comments on commit 3de1e33

Please sign in to comment.