Skip to content

Commit 97a5203

Browse files
committed
test: Improve test assertions
1 parent 524853a commit 97a5203

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

tests/Constraints/TypeTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ public function testValidateTypeNameWording($nameWording)
116116
$m->setAccessible(true);
117117

118118
$m->invoke($t, $nameWording);
119+
$this->expectNotToPerformAssertions();
119120
}
120121

121122
public function testInvalidateTypeNameWording()

tests/Uri/Retrievers/CurlTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ class CurlTest extends TestCase
1010
public function testRetrieveFile()
1111
{
1212
$c = new Curl();
13-
$c->retrieve(realpath(__DIR__ . '/../../fixtures/foobar.json'));
13+
$result = $c->retrieve(realpath(__DIR__ . '/../../fixtures/foobar.json'));
14+
15+
self::assertStringEqualsFileCanonicalizing(realpath(__DIR__ . '/../../fixtures/foobar.json'), $result);
1416
}
1517

1618
public function testRetrieveNonexistantFile()
@@ -26,7 +28,9 @@ public function testRetrieveNonexistantFile()
2628
public function testNoContentType()
2729
{
2830
$c = new Curl();
29-
$c->retrieve(realpath(__DIR__ . '/../../fixtures') . '/foobar-noheader.json');
31+
$result = $c->retrieve(realpath(__DIR__ . '/../../fixtures') . '/foobar-noheader.json');
32+
33+
self::assertStringEqualsFileCanonicalizing(realpath(__DIR__ . '/../../fixtures/foobar.json'), $result);
3034
}
3135
}
3236
}

tests/Uri/UriRetrieverTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,9 @@ public function testInvalidContentTypeEndpointsAdded()
358358
$retriever = new UriRetriever();
359359
$retriever->addInvalidContentTypeEndpoint('http://example.com');
360360

361-
$retriever->confirmMediaType($mock, 'http://example.com');
361+
$result = $retriever->confirmMediaType($mock, 'http://example.com');
362+
363+
self::assertTrue($result);
362364
}
363365

364366
public function testSchemaCache()

0 commit comments

Comments
 (0)