Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
daedeloth committed May 3, 2022
2 parents a971ae7 + da03217 commit e0be7f5
Show file tree
Hide file tree
Showing 8 changed files with 7,653 additions and 11,076 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ vendor/
.idea/
composer.lock
docs-html
node_modules
node_modules
/.phpunit.result.cache
11 changes: 8 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"ext-mbstring": "*"
},
"require-dev": {
"phpunit/phpunit": "5.3.*",
"catlabinteractive/cursor-pagination" : "^1.0.7"
"phpunit/phpunit": "^9.0",
"catlabinteractive/cursor-pagination" : "^1.0.8"
},
"license": "MIT",
"authors": [
Expand All @@ -29,5 +29,10 @@
"App\\":"example/"
}
},
"minimum-stability" : "dev"
"minimum-stability" : "dev",
"config": {
"platform": {
"php": "8.0"
}
}
}
18,675 changes: 7,617 additions & 11,058 deletions docusaurus/package-lock.json

Large diffs are not rendered by default.

23 changes: 13 additions & 10 deletions docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,22 @@
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.6",
"@docusaurus/preset-classic": "2.0.0-beta.6",
"@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^5.5.0",
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/preset-classic": "2.0.0-beta.18",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.1.1",
"file-loader": "^6.2.0",
"prism-react-renderer": "^1.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"url-loader": "^4.1.1"
"prism-react-renderer": "^1.3.1",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.18",
"@tsconfig/docusaurus": "^1.0.5",
"typescript": "^4.6.3"
},
"browserslist": {
"production": [
Expand Down
4 changes: 3 additions & 1 deletion src/Collections/RouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,16 @@ public function resource($resourceDefinition, $path, $controller, $options)
}

if (in_array(self::OPTIONS_METHOD_DESTROY, $only)) {
$group->delete($path . '/{' . $id . '}', $controller . '@destroy', [], 'destroy')
$deleteRoute = $group->delete($path . '/{' . $id . '}', $controller . '@destroy', [], 'destroy')
->summary(function () use ($resourceDefinitionFactory) {
$entityName = $resourceDefinitionFactory->getDefault()->getEntityName(false);

return 'Delete a ' . $entityName;
})
->parameters()->path($id)->string()->required()
;

$this->addIdParameterToRoutePath($deleteRoute, $id, $options);
}

return $group;
Expand Down
3 changes: 2 additions & 1 deletion tests/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
use CatLab\Charon\Interfaces\PropertyResolver as PropertyResolverContract;
use CatLab\Charon\Resolvers\PropertySetter;
use CatLab\Charon\Resolvers\RequestResolver;
use PHPUnit\Framework\TestCase;
use Tests\Models\MockPropertyResolver;
use Tests\Models\MockQueryAdapter;

abstract class BaseTest extends \PHPUnit_Framework_TestCase
abstract class BaseTest extends TestCase
{
public function getResourceTransformer(PropertyResolverContract $propertyResolver = null)
{
Expand Down
3 changes: 2 additions & 1 deletion tests/ScalarTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

use CatLab\Charon\Transformers\ScalarTransformer;
use CatLab\Requirements\Enums\PropertyType;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_TestCase;

/**
* Class ScalarTransformerTest
* @package CatLab\RESTResource\Tests
*/
class ScalarTransformerTest extends PHPUnit_Framework_TestCase
class ScalarTransformerTest extends TestCase
{
/**
*
Expand Down
7 changes: 6 additions & 1 deletion tests/ValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,15 @@ public function testPetInput()
}

/**
* @expectedException \CatLab\Requirements\Exceptions\ResourceValidationException
* @return void
* @throws \CatLab\Charon\Exceptions\InvalidContextAction
* @throws \CatLab\Charon\Exceptions\InvalidPropertyException
* @throws \CatLab\Charon\Exceptions\InvalidResourceDefinition
*/
public function testPetNotEnoughPhotos()
{
$this->expectException(\CatLab\Requirements\Exceptions\ResourceValidationException::class);

$transformer = $this->getResourceTransformer();
$context = new Context(Action::CREATE);

Expand Down

0 comments on commit e0be7f5

Please sign in to comment.