Skip to content

Commit

Permalink
Use dedicated PHPUnit assertions (#1331)
Browse files Browse the repository at this point in the history
  • Loading branch information
carusogabriel authored and dwsupplee committed Oct 2, 2018
1 parent 84b7b13 commit 691f3a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions tests/Unit/AgentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function testDefaultMaxStringLength()
$this->assertInstanceOf(Breakpoint::class, $item[1]);
$stackframes = $item[1]->stackFrames();
$this->assertCount(1, $stackframes);
$this->assertEquals(1, count($stackframes[0]->locals()));
$this->assertCount(1, $stackframes[0]->locals());
$variable = $stackframes[0]->locals()[0];
$this->assertEquals(500, strlen($variable->info()['value']));
return true;
Expand All @@ -145,7 +145,7 @@ public function testSetsMaxStringLength()
$this->assertInstanceOf(Breakpoint::class, $item[1]);
$stackframes = $item[1]->stackFrames();
$this->assertCount(1, $stackframes);
$this->assertEquals(1, count($stackframes[0]->locals()));
$this->assertCount(1, $stackframes[0]->locals());
$variable = $stackframes[0]->locals()[0];
$this->assertEquals(1000, strlen($variable->info()['value']));
return true;
Expand Down Expand Up @@ -173,7 +173,7 @@ public function testDefaultMaxPayloadSize()
$this->assertInstanceOf(Breakpoint::class, $item[1]);
$stackframes = $item[1]->stackFrames();
$this->assertCount(1, $stackframes);
$this->assertEquals(245, count($stackframes[0]->locals()));
$this->assertCount(245, $stackframes[0]->locals());
return true;
};
$agent = $this->setupAgent($itemMatcher, []);
Expand All @@ -200,7 +200,7 @@ public function testSetsMaxPayloadSize()
// Each entry takes 6 + 3 + 10 bytes = 19 bytes
// We stop after 900 bytes (1000 - 100 buffer)
// 19 bytes * 48 = 912 bytes
$this->assertEquals(48, count($stackframes[0]->locals()));
$this->assertCount(48, $stackframes[0]->locals());
return true;
};
$agent = $this->setupAgent($itemMatcher, [
Expand Down Expand Up @@ -249,7 +249,7 @@ public function testDefaultMaxMemberDepth()
$this->assertInstanceOf(Breakpoint::class, $item[1]);
$stackframes = $item[1]->stackFrames();
$this->assertCount(1, $stackframes);
$this->assertEquals(1, count($stackframes[0]->locals()));
$this->assertCount(1, $stackframes[0]->locals());

$data = $stackframes[0]->locals()[0]->info();
$depth = 5;
Expand Down Expand Up @@ -299,7 +299,7 @@ public function testSetsMaxMemberDepth()
$this->assertInstanceOf(Breakpoint::class, $item[1]);
$stackframes = $item[1]->stackFrames();
$this->assertCount(1, $stackframes);
$this->assertEquals(1, count($stackframes[0]->locals()));
$this->assertCount(1, $stackframes[0]->locals());

$data = $stackframes[0]->locals()[0]->info();
$depth = 3;
Expand Down Expand Up @@ -351,7 +351,7 @@ public function testDefaultMaxMembers()
$this->assertInstanceOf(Breakpoint::class, $item[1]);
$stackframes = $item[1]->stackFrames();
$this->assertCount(1, $stackframes);
$this->assertEquals(1, count($stackframes[0]->locals()));
$this->assertCount(1, $stackframes[0]->locals());
$variable = $stackframes[0]->locals()[0];
$this->assertCount(1000, $variable->info()['members']);
return true;
Expand All @@ -377,7 +377,7 @@ public function testSetsMaxMembers()
$this->assertInstanceOf(Breakpoint::class, $item[1]);
$stackframes = $item[1]->stackFrames();
$this->assertCount(1, $stackframes);
$this->assertEquals(1, count($stackframes[0]->locals()));
$this->assertCount(1, $stackframes[0]->locals());
$variable = $stackframes[0]->locals()[0];
$this->assertCount(5, $variable->info()['members']);
return true;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/VariableTableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public function testLimitsTotalSize()
$this->assertTrue($exceptionThrown);
$variables = $variableTable->variables();
$this->assertNotEmpty($variables);
$this->assertTrue(count($variableTable->variables()) < 1000);
$this->assertLessThan(1000, count($variableTable->variables()));

$bufferFullReference = $variableTable->bufferFullVariable();
$index = $bufferFullReference->info()['varTableIndex'];
Expand Down

0 comments on commit 691f3a7

Please sign in to comment.