Skip to content

Commit

Permalink
Add red test
Browse files Browse the repository at this point in the history
  • Loading branch information
NaokiTsuchiya committed Mar 21, 2021
1 parent 26ec545 commit ed593ce
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/AlpsProfileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ public function testReadPhpInput(): void
stream_wrapper_restore('php');
}

public function testExternalRt(): void
{
$profile = new AlpsProfile(__DIR__ . '/Fake/alps.rt_external.json');
$this->assertSame('foo (safe)', (string) $profile->links['Index->Foo:foo']);
}

public function testFileNotReadable(): void
{
$this->expectException(AlpsFileNotReadableException::class);
Expand Down
12 changes: 12 additions & 0 deletions tests/Fake/alps.external.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://alps-io.github.io/schemas/alps.json",
"alps": {
"descriptor": [
{"id": "Foo", "descriptor": [
{"href": "#id"}
]
},
{"id": "id"}
]
}
}
11 changes: 11 additions & 0 deletions tests/Fake/alps.rt_external.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://alps-io.github.io/schemas/alps.json",
"alps": {
"descriptor": [
{"id": "Index", "descriptor": [
{"href": "#foo"}
]},
{"id": "foo", "type": "safe", "rt": "Foo.json#Foo"}
]
}
}

0 comments on commit ed593ce

Please sign in to comment.