Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oanhnn committed Jul 3, 2017
1 parent a7a32d3 commit 8d535ae
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
11 changes: 10 additions & 1 deletion phpunit.xml.dist
Expand Up @@ -19,7 +19,7 @@

<!-- Add any additional test suites you want to run here -->
<testsuites>
<testsuite name="Test Source">
<testsuite name="LemonPHP Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
Expand All @@ -33,4 +33,13 @@
<directory suffix=".php">src</directory>
</whitelist>
</filter>

<!-- Logging testing reports -->
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>
2 changes: 1 addition & 1 deletion tests/Document/CompoundDocumentTest.php
Expand Up @@ -55,7 +55,7 @@ public function testIncludedResourcesRepresentedAsArray()
)
)
);
$doc = \Lemon\JsonApi\Document::fromResource($basket);
$doc = Document::fromResource($basket);
$doc->setIncluded($apple, $orange);
$this->assertEquals(
[
Expand Down
18 changes: 18 additions & 0 deletions tests/Document/DocumentTest.php
Expand Up @@ -111,6 +111,24 @@ public function testDocumentMayContainVersion()
);
}

public function testDocumentMayResetVersion()
{
$doc = $this->createNullDoc();
$doc->setApiMeta(['a' => 'b']);
$doc->setApiVersion('1.2.3');

$this->assertEqualsAsJson(
[
'data' => null,
'jsonapi' => [
'version' => '1.2.3',
'meta' => ['a' => 'b'],
],
],
$doc
);
}

public function testDocumentMayContainLinks()
{
$doc = $this->createNullDoc();
Expand Down

0 comments on commit 8d535ae

Please sign in to comment.