Skip to content

Commit

Permalink
Use assertInternalType
Browse files Browse the repository at this point in the history
  • Loading branch information
carusogabriel committed Dec 3, 2017
1 parent 3ab1a15 commit d73f410
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/Http/BodyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function testGetMetadata()
$this->stream = $this->resourceFactory();
$body = new Body($this->stream);

$this->assertTrue(is_array($body->getMetadata()));
$this->assertInternalType('array', $body->getMetadata());
}

public function testGetMetadataKey()
Expand Down
16 changes: 8 additions & 8 deletions tests/Http/HeadersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function testCreateFromEnvironment()
$prop = new ReflectionProperty($h, 'data');
$prop->setAccessible(true);

$this->assertTrue(is_array($prop->getValue($h)['accept']));
$this->assertInternalType('array', $prop->getValue($h)['accept']);
$this->assertEquals('application/json', $prop->getValue($h)['accept']['value'][0]);
}

Expand All @@ -36,7 +36,7 @@ public function testCreateFromEnvironmentWithSpecialHeaders()
$prop = new ReflectionProperty($h, 'data');
$prop->setAccessible(true);

$this->assertTrue(is_array($prop->getValue($h)['content-type']));
$this->assertInternalType('array', $prop->getValue($h)['content-type']);
$this->assertEquals('application/json', $prop->getValue($h)['content-type']['value'][0]);
}

Expand All @@ -61,7 +61,7 @@ public function testConstructor()
$prop = new ReflectionProperty($h, 'data');
$prop->setAccessible(true);

$this->assertTrue(is_array($prop->getValue($h)['content-length']));
$this->assertInternalType('array', $prop->getValue($h)['content-length']);
$this->assertEquals(100, $prop->getValue($h)['content-length']['value'][0]);
}

Expand All @@ -72,7 +72,7 @@ public function testSetSingleValue()
$prop = new ReflectionProperty($h, 'data');
$prop->setAccessible(true);

$this->assertTrue(is_array($prop->getValue($h)['content-length']));
$this->assertInternalType('array', $prop->getValue($h)['content-length']);
$this->assertEquals(100, $prop->getValue($h)['content-length']['value'][0]);
}

Expand All @@ -83,7 +83,7 @@ public function testSetArrayValue()
$prop = new ReflectionProperty($h, 'data');
$prop->setAccessible(true);

$this->assertTrue(is_array($prop->getValue($h)['allow']));
$this->assertInternalType('array', $prop->getValue($h)['allow']);
$this->assertEquals(['GET', 'POST'], $prop->getValue($h)['allow']['value']);
}

Expand Down Expand Up @@ -129,7 +129,7 @@ public function testAddNewValue()
$prop = new ReflectionProperty($h, 'data');
$prop->setAccessible(true);

$this->assertTrue(is_array($prop->getValue($h)['foo']));
$this->assertInternalType('array', $prop->getValue($h)['foo']);
$this->assertEquals(['Bar'], $prop->getValue($h)['foo']['value']);
}

Expand All @@ -141,7 +141,7 @@ public function testAddAnotherValue()
$prop = new ReflectionProperty($h, 'data');
$prop->setAccessible(true);

$this->assertTrue(is_array($prop->getValue($h)['foo']));
$this->assertInternalType('array', $prop->getValue($h)['foo']);
$this->assertEquals(['Bar', 'Xyz'], $prop->getValue($h)['foo']['value']);
}

Expand All @@ -153,7 +153,7 @@ public function testAddArrayValue()
$prop = new ReflectionProperty($h, 'data');
$prop->setAccessible(true);

$this->assertTrue(is_array($prop->getValue($h)['foo']));
$this->assertInternalType('array', $prop->getValue($h)['foo']);
$this->assertEquals(['Bar', 'Xyz', '123'], $prop->getValue($h)['foo']['value']);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Http/RequestBodyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ public function testConstructorSetsMetadata()
$bodyMetadata = new ReflectionProperty($this->body, 'meta');
$bodyMetadata->setAccessible(true);

$this->assertTrue(is_array($bodyMetadata->getValue($this->body)));
$this->assertInternalType('array', $bodyMetadata->getValue($this->body));
}

public function testGetMetadata()
{
$this->assertTrue(is_array($this->body->getMetadata()));
$this->assertInternalType('array', $this->body->getMetadata());
}

public function testGetMetadataKey()
Expand Down
2 changes: 1 addition & 1 deletion tests/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function testGetCallable()
{
$callable = $this->routeFactory()->getCallable();

$this->assertTrue(is_callable($callable));
$this->assertInternalType('callable', $callable);
}

public function testArgumentSetting()
Expand Down

0 comments on commit d73f410

Please sign in to comment.