diff --git a/tests/DebugBar/Tests/DataCollector/AggregatedCollectorTest.php b/tests/DebugBar/Tests/DataCollector/AggregatedCollectorTest.php index 51cb6e2..c485d63 100644 --- a/tests/DebugBar/Tests/DataCollector/AggregatedCollectorTest.php +++ b/tests/DebugBar/Tests/DataCollector/AggregatedCollectorTest.php @@ -19,7 +19,7 @@ class AggregatedCollectorTest extends DebugBarTestCase $this->c->addCollector($c = new MockCollector()); $this->assertContains($c, $this->c->getCollectors()); $this->assertEquals($c, $this->c['mock']); - $this->assertTrue(isset($this->c['mock'])); + $this->assertArrayHasKey('mock', $this->c); } public function testCollect() diff --git a/tests/DebugBar/Tests/DataCollector/TimeDataCollectorTest.php b/tests/DebugBar/Tests/DataCollector/TimeDataCollectorTest.php index fc336e3..eb05c8a 100644 --- a/tests/DebugBar/Tests/DataCollector/TimeDataCollectorTest.php +++ b/tests/DebugBar/Tests/DataCollector/TimeDataCollectorTest.php @@ -37,7 +37,7 @@ class TimeDataCollectorTest extends DebugBarTestCase $this->assertEquals('bar', $m[0]['label']); $this->assertEquals('baz', $m[0]['collector']); $this->assertEquals(array('bar' => 'baz'), $m[0]['params']); - $this->assertTrue($m[0]['start'] < $m[0]['end']); + $this->assertLessThan($m[0]['end'], $m[0]['start']); } public function testCollect() @@ -45,8 +45,8 @@ class TimeDataCollectorTest extends DebugBarTestCase $this->c->addMeasure('foo', 0, 10); $this->c->addMeasure('bar', 10, 20); $data = $this->c->collect(); - $this->assertTrue($data['end'] > $this->s); - $this->assertTrue($data['duration'] > 0); + $this->assertGreaterThan($this->s, $data['end']); + $this->assertGreaterThan(0, $data['duration']); $this->assertCount(2, $data['measures']); } @@ -59,7 +59,7 @@ class TimeDataCollectorTest extends DebugBarTestCase $m = $this->c->getMeasures(); $this->assertCount(1, $m); $this->assertEquals('bar', $m[0]['label']); - $this->assertTrue($m[0]['start'] < $m[0]['end']); + $this->assertLessThan($m[0]['end'], $m[0]['start']); $this->assertSame('returnedValue', $returned); } } diff --git a/tests/DebugBar/Tests/DebugBarTest.php b/tests/DebugBar/Tests/DebugBarTest.php index a917f55..7bd152c 100644 --- a/tests/DebugBar/Tests/DebugBarTest.php +++ b/tests/DebugBar/Tests/DebugBarTest.php @@ -42,8 +42,8 @@ class DebugBarTest extends DebugBarTestCase { $this->debugbar->addCollector($c = new MockCollector()); $this->assertEquals($c, $this->debugbar['mock']); - $this->assertTrue(isset($this->debugbar['mock'])); - $this->assertFalse(isset($this->debugbar['foo'])); + $this->assertArrayHasKey('mock', $this->debugbar); + $this->assertArrayNotHasKey('foo', $this->debugbar); } public function testStorage() @@ -96,7 +96,7 @@ class DebugBarTest extends DebugBarTestCase $data = $this->debugbar->getStackedData(); $this->assertArrayNotHasKey($ns, $http->session); $this->assertArrayHasKey($id, $data); - $this->assertEquals(1, count($data)); + $this->assertCount(1, $data); $this->assertArrayHasKey('mock', $data[$id]); $this->assertEquals($c->collect(), $data[$id]['mock']); } diff --git a/tests/DebugBar/Tests/DebugBarTestCase.php b/tests/DebugBar/Tests/DebugBarTestCase.php index 6ab2d17..e61b5fd 100644 --- a/tests/DebugBar/Tests/DebugBarTestCase.php +++ b/tests/DebugBar/Tests/DebugBarTestCase.php @@ -19,13 +19,13 @@ abstract class DebugBarTestCase extends TestCase public function assertJsonIsArray($json) { $data = json_decode($json); - $this->assertTrue(is_array($data)); + $this->assertIsArray($data); } public function assertJsonIsObject($json) { $data = json_decode($json); - $this->assertTrue(is_object($data)); + $this->assertIsObject($data); } public function assertJsonArrayNotEmpty($json)