Skip to content

Commit

Permalink
Refactoring tests
Browse files Browse the repository at this point in the history
  • Loading branch information
carusogabriel committed Dec 6, 2017
1 parent 8875d3c commit 7da6778
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/BatchResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function testABatchResponseCanBeIteratedOver()
$this->assertInstanceOf(\IteratorAggregate::class, $batchResponse);

foreach ($batchResponse as $key => $responseEntity) {
$this->assertTrue(in_array($key, ['req_one', 'req_two', 'req_three']));
$this->assertContains($key, ['req_one', 'req_two', 'req_three']);
$this->assertInstanceOf(Response::class, $responseEntity);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/FacebookTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public function testCreatingANewBatchRequestWillDefaultToTheProperConfig()
$fb->getClient()->getBaseGraphUrl()
);
$this->assertInstanceOf('Facebook\BatchRequest', $batchRequest);
$this->assertEquals(0, count($batchRequest->getRequests()));
$this->assertCount(0, $batchRequest->getRequests());
}

public function testCanInjectCustomHandlers()
Expand Down
4 changes: 1 addition & 3 deletions tests/GraphNode/CollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ public function testACollectionCanBeCounted()
{
$collection = new Collection(['foo', 'bar', 'baz']);

$collectionCount = count($collection);

$this->assertEquals(3, $collectionCount);
$this->assertCount(3, $collection);
}

public function testACollectionCanBeAccessedAsAnArray()
Expand Down
2 changes: 1 addition & 1 deletion tests/GraphNode/GraphAchievementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function testNoFeedStoryIsBoolean()

$isNoFeedStory = $graphNode->isNoFeedStory();

$this->assertTrue(is_bool($isNoFeedStory));
$this->assertInternalType('bool', $isNoFeedStory);
}

public function testDatesGetCastToDateTime()
Expand Down
4 changes: 2 additions & 2 deletions tests/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function testAFileCanBeAddedToParams()

$this->assertTrue($request->containsFileUploads());
$this->assertFalse($request->containsVideoUploads());
$this->assertFalse(isset($actualParams['source']));
$this->assertArrayNotHasKey('source', $actualParams);
$this->assertEquals('Foo Bar', $actualParams['name']);
}

Expand All @@ -200,7 +200,7 @@ public function testAVideoCanBeAddedToParams()

$this->assertTrue($request->containsFileUploads());
$this->assertTrue($request->containsVideoUploads());
$this->assertFalse(isset($actualParams['source']));
$this->assertArrayNotHasKey('source', $actualParams);
$this->assertEquals('Foo Bar', $actualParams['name']);
}
}

0 comments on commit 7da6778

Please sign in to comment.