Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ before_install:

script:
- cp config/example.settings.yml config/settings.dev.yml
- php vendor/bin/phpunit --group UnitTest --coverage-clover=coverage.xml
- php vendor/bin/phpunit --group UnitTest
- php vendor/bin/phpcs --standard=PSR2 src test

notifications:
Expand Down
17 changes: 14 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit bootstrap="./test/bootstrap.php"
colors="true">
<phpunit bootstrap="./test/bootstrap.php" colors="true">
<testsuites>
<testsuite name="Crayfish">
<directory>test</directory>
</testsuite>
</testsuites>
</phpunit>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
<exclude>
<file>src/index.php</file>
<file>src/app.php</file>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="coverage.xml"/>
</logging>
</phpunit>
23 changes: 13 additions & 10 deletions src/Provider/CrayfishProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,7 @@ function ($id) use ($app) {
// Run only if $id given /can also be refering root resource,
// we accept only UUID V4 or empty
if (null != $id) {
$sparql_query = $app['twig']->render(
'getResourceByUUIDfromTS.sparql',
array(
'uuid' => $id,
)
);
$sparql_query = $app['twig']->render('getResourceByUUIDfromTS.sparql', array('uuid' => $id));
try {
$sparql_result = $app['triplestore']->query($sparql_query);
} catch (\Exception $e) {
Expand All @@ -162,12 +157,19 @@ function ($id) use ($app) {

}

/**
* Inherits from ServiceProviderInterface
*
* @codeCoverageIgnore
*/
public function boot(Application $app)
{
}

/**
* Part of ControllerProviderInterface
*
* @codeCoverageIgnore
*/
public function connect(Application $app)
{
Expand Down Expand Up @@ -212,15 +214,16 @@ public function connect(Application $app)
->value('child', "")
->before(
function (Request $request) {
if (isset($request->attributes->parameters) && $request->attributes->parameters->has('id')) {
if (isset($request->attributes) && $request->attributes->has('id')) {
// To get this to work we need to GET /islandora/resource//tx:id
// So we move the $id to the $child parameter.
$id = $request->attributes->parameters->get('id');
$request->attributes->parameters->set('child', $id);
$request->attributes->parameters->set('id', '');
$id = $request->attributes->get('id');
$request->attributes->set('child', $id);
$request->attributes->set('id', '');
}
}
)
->convert('id', $app['islandora.idToUri'])
->bind('islandora.transactionGet');

$controllers->post("/transaction", "islandora.transactioncontroller:create")
Expand Down
Loading