Skip to content

Commit

Permalink
chore(deps): Bump archict/core from 1.0.3 to 1.1.0 (#85)
Browse files Browse the repository at this point in the history
Bumps [archict/core](https://github.com/Archict/core) from 1.0.3 to
1.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Archict/core/releases">archict/core's
releases</a>.</em></p>
<blockquote>
<h2>v1.1.0</h2>
<!-- raw HTML omitted -->
<h2>What's Changed</h2>
<h3>New Features 🎉</h3>
<ul>
<li>feat: Cache directory is configurable by <a
href="https://github.com/Gashmob"><code>@​Gashmob</code></a> in <a
href="https://redirect.github.com/Archict/core/pull/94">Archict/core#94</a></li>
<li>feat: Configuration dir can be set in env by <a
href="https://github.com/Gashmob"><code>@​Gashmob</code></a> in <a
href="https://redirect.github.com/Archict/core/pull/98">Archict/core#98</a></li>
<li>feat: Services lazy loading by <a
href="https://github.com/Gashmob"><code>@​Gashmob</code></a> in <a
href="https://redirect.github.com/Archict/core/pull/99">Archict/core#99</a></li>
</ul>
<h3>Bug fixes 🛠</h3>
<ul>
<li>chore: Skip BrickLoader test by <a
href="https://github.com/Gashmob"><code>@​Gashmob</code></a> in <a
href="https://redirect.github.com/Archict/core/pull/97">Archict/core#97</a></li>
</ul>
<h3>Dependencies updates</h3>
<ul>
<li>chore(deps-dev): Bump squizlabs/php_codesniffer from 3.11.1 to
3.11.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/Archict/core/pull/90">Archict/core#90</a></li>
<li>chore(deps-dev): Bump phpstan/phpstan from 2.0.3 to 2.0.4 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/Archict/core/pull/91">Archict/core#91</a></li>
<li>chore(deps): Bump archict/brick from 1.0.2 to 1.0.3 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/Archict/core/pull/100">Archict/core#100</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Archict/core/compare/v1.0.3...v1.1.0">https://github.com/Archict/core/compare/v1.0.3...v1.1.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/Archict/core/commit/fb870528d47c9ef7f7b561bd7acbb917734ae7a8"><code>fb87052</code></a>
chore(deps): Bump archict/brick from 1.0.2 to 1.0.3 (<a
href="https://redirect.github.com/Archict/core/issues/100">#100</a>)</li>
<li><a
href="https://github.com/Archict/core/commit/2e0fe74d4674a6e75884e60e93b927ff09319e31"><code>2e0fe74</code></a>
chore(deps-dev): Bump phpstan/phpstan from 2.0.3 to 2.0.4 (<a
href="https://redirect.github.com/Archict/core/issues/91">#91</a>)</li>
<li><a
href="https://github.com/Archict/core/commit/3c5b75ae003818f58893624f500f7e2040875557"><code>3c5b75a</code></a>
chore(deps-dev): Bump squizlabs/php_codesniffer from 3.11.1 to 3.11.2
(<a
href="https://redirect.github.com/Archict/core/issues/90">#90</a>)</li>
<li><a
href="https://github.com/Archict/core/commit/9cad16a6f21df682a691c3755c94ce6eb23aa858"><code>9cad16a</code></a>
chore(deps): Bump archict/brick from 1.0.2 to 1.0.3</li>
<li><a
href="https://github.com/Archict/core/commit/9f05b6ec9fca81ae132f1e93d77a95ca94a782a5"><code>9f05b6e</code></a>
chore(deps-dev): Bump phpstan/phpstan from 2.0.3 to 2.0.4</li>
<li><a
href="https://github.com/Archict/core/commit/a8356256e5c1034ef1d185572310664c924e4bd0"><code>a835625</code></a>
chore(deps-dev): Bump squizlabs/php_codesniffer from 3.11.1 to
3.11.2</li>
<li><a
href="https://github.com/Archict/core/commit/f1942bba2c4f95c2f5a04554580f0595a25ecabe"><code>f1942bb</code></a>
feat: Services lazy loading (<a
href="https://redirect.github.com/Archict/core/issues/99">#99</a>)</li>
<li><a
href="https://github.com/Archict/core/commit/41b2800c879cf44790fb5605f6fd7ca7a023f7ff"><code>41b2800</code></a>
feat: Services lazy loading</li>
<li><a
href="https://github.com/Archict/core/commit/fbfec61c2124c28a55b1cc5e5b48f9cb124ab45c"><code>fbfec61</code></a>
feat: Configuration dir can be set in env (<a
href="https://redirect.github.com/Archict/core/issues/98">#98</a>)</li>
<li><a
href="https://github.com/Archict/core/commit/a689b5dbc72797bbc206284b7abf0a599c81202d"><code>a689b5d</code></a>
feat: Configuration dir can be set in env</li>
<li>Additional commits viewable in <a
href="https://github.com/Archict/core/compare/v1.0.3...v1.1.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=archict/core&package-manager=composer&previous-version=1.0.3&new-version=1.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>
  • Loading branch information
Gashmob authored Dec 30, 2024
2 parents 9aa9e7d + 17fb63b commit fd9f493
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 44 deletions.
54 changes: 27 additions & 27 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 26 additions & 17 deletions tests/unit/Route/RouteCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,24 @@
use Archict\Router\Method;
use Archict\Router\RequestHandler;
use Archict\Router\ResponseFactory;
use CuyZ\Valinor\Mapper\TreeMapper;
use CuyZ\Valinor\MapperBuilder;
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;

final class RouteCollectionTest extends TestCase
{
private TreeMapper $mapper;

protected function setUp(): void
{
$this->mapper = (new MapperBuilder())->enableFlexibleCasting()->allowSuperfluousKeys()->allowPermissiveTypes()->mapper();
}

public function testItCanAddRouteWithRequestHandler(): void
{
$collection = new RouteCollection(new ServiceManager());
$collection = new RouteCollection(new ServiceManager($this->mapper));
self::assertTrue(
$collection->addRoute(
Method::GET,
Expand All @@ -59,15 +68,15 @@ public function handle(ServerRequestInterface $request): ResponseInterface // ph

public function testItCanAddRouteWithCallable(): void
{
$collection = new RouteCollection(new ServiceManager());
$collection = new RouteCollection(new ServiceManager($this->mapper));
self::assertTrue(
$collection->addRoute(Method::GET, 'route', static fn(ServerRequestInterface $request) => ResponseFactory::build()->get()) // phpcs:ignore
);
}

public function testItCanAddRouteWithClassname(): void
{
$collection = new RouteCollection(new ServiceManager());
$collection = new RouteCollection(new ServiceManager($this->mapper));
$handler = new class implements RequestHandler {
public function handle(ServerRequestInterface $request): ResponseInterface // phpcs:ignore
{
Expand All @@ -79,7 +88,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface // ph

public function testItNotAcceptIfAddTwiceSameRoute(): void
{
$collection = new RouteCollection(new ServiceManager());
$collection = new RouteCollection(new ServiceManager($this->mapper));
self::assertTrue(
$collection->addRoute(Method::GET, 'route', static fn(ServerRequestInterface $request) => ResponseFactory::build()->get()) // phpcs:ignore
);
Expand All @@ -90,7 +99,7 @@ public function testItNotAcceptIfAddTwiceSameRoute(): void

public function testItAcceptSameRouteDifferentMethod(): void
{
$collection = new RouteCollection(new ServiceManager());
$collection = new RouteCollection(new ServiceManager($this->mapper));
self::assertTrue(
$collection->addRoute(Method::GET, 'route', static fn(ServerRequestInterface $request) => ResponseFactory::build()->get()) // phpcs:ignore
);
Expand All @@ -101,7 +110,7 @@ public function testItAcceptSameRouteDifferentMethod(): void

public function testItNotAcceptSameRouteWithMethodAll(): void
{
$collection = new RouteCollection(new ServiceManager());
$collection = new RouteCollection(new ServiceManager($this->mapper));
self::assertTrue(
$collection->addRoute(Method::GET, 'route', static fn(ServerRequestInterface $request) => ResponseFactory::build()->get()) // phpcs:ignore
);
Expand All @@ -112,7 +121,7 @@ public function testItNotAcceptSameRouteWithMethodAll(): void

public function testItNotAcceptSameRouteIfFirstIsMethodAll(): void
{
$collection = new RouteCollection(new ServiceManager());
$collection = new RouteCollection(new ServiceManager($this->mapper));
self::assertTrue(
$collection->addRoute(Method::ALL, 'route', static fn(ServerRequestInterface $request) => ResponseFactory::build()->get()) // phpcs:ignore
);
Expand All @@ -123,7 +132,7 @@ public function testItNotAcceptSameRouteIfFirstIsMethodAll(): void

public function testItAcceptSeveralRoute(): void
{
$collection = new RouteCollection(new ServiceManager());
$collection = new RouteCollection(new ServiceManager($this->mapper));
self::assertTrue(
$collection->addRoute(Method::GET, 'route1', static fn(ServerRequestInterface $request) => ResponseFactory::build()->get()) // phpcs:ignore
);
Expand All @@ -137,7 +146,7 @@ public function testItAcceptSeveralRoute(): void

public function testItAcceptSameRouteWithDifferentGroup(): void
{
$collection = new RouteCollection(new ServiceManager());
$collection = new RouteCollection(new ServiceManager($this->mapper));
self::assertTrue(
$collection->addRoute(Method::GET, '{group:\d+}', static fn(ServerRequestInterface $request) => ResponseFactory::build()->get()) // phpcs:ignore
);
Expand All @@ -148,22 +157,22 @@ public function testItAcceptSameRouteWithDifferentGroup(): void

public function testItThrowIfRouteNotFound(): void
{
$collection = new RouteCollection(new ServiceManager());
$collection = new RouteCollection(new ServiceManager($this->mapper));
self::expectException(NotFoundException::class);
$collection->getMatchingRoute('', 'GET');
}

public function testItThrowIfMethodNotAllowed(): void
{
$collection = new RouteCollection(new ServiceManager());
$collection = new RouteCollection(new ServiceManager($this->mapper));
$collection->addRoute(Method::GET, 'route', static fn(ServerRequestInterface $request) => ResponseFactory::build()->get()); // phpcs:ignore
self::expectException(MethodNotAllowedException::class);
$collection->getMatchingRoute('route', 'POST');
}

public function testItCanFindMatchingRouteSimple(): void
{
$collection = new RouteCollection(new ServiceManager());
$collection = new RouteCollection(new ServiceManager($this->mapper));
$collection->addRoute(Method::ALL, 'route', static fn(ServerRequestInterface $request) => ResponseFactory::build()->get()); // phpcs:ignore
$route = $collection->getMatchingRoute('route', 'PATCH');

Expand All @@ -173,7 +182,7 @@ public function testItCanFindMatchingRouteSimple(): void

public function testItCanFindMatchingRouteWithGroup(): void
{
$collection = new RouteCollection(new ServiceManager());
$collection = new RouteCollection(new ServiceManager($this->mapper));
$collection->addRoute(Method::GET, 'article/{id:\d+}', static fn(ServerRequestInterface $request) => ResponseFactory::build()->get()); // phpcs:ignore
$route = $collection->getMatchingRoute('article/5', 'GET');

Expand All @@ -183,28 +192,28 @@ public function testItCanFindMatchingRouteWithGroup(): void

public function testItCanAddMiddlewareWithCallable(): void
{
$collection = new RouteCollection(new ServiceManager());
$collection = new RouteCollection(new ServiceManager($this->mapper));
self::expectNotToPerformAssertions();
$collection->addMiddleware(Method::GET, 'route', static fn(ServerRequestInterface $request) => $request);
}

public function testItCanAddMiddlewareWithMiddleware(): void
{
$collection = new RouteCollection(new ServiceManager());
$collection = new RouteCollection(new ServiceManager($this->mapper));
self::expectNotToPerformAssertions();
$collection->addMiddleware(Method::GET, 'route', new IdentityMiddlewareStub());
}

public function testItCanAddMiddlewareWithClassname(): void
{
$collection = new RouteCollection(new ServiceManager());
$collection = new RouteCollection(new ServiceManager($this->mapper));
self::expectNotToPerformAssertions();
$collection->addMiddleware(Method::GET, 'route', IdentityMiddlewareStub::class);
}

public function testItAcceptMultipleMiddlewareOnSameRoute(): void
{
$collection = new RouteCollection(new ServiceManager());
$collection = new RouteCollection(new ServiceManager($this->mapper));
self::expectNotToPerformAssertions();
$collection->addMiddleware(Method::GET, 'route', new IdentityMiddlewareStub());
$collection->addMiddleware(Method::GET, 'route', new IdentityMiddlewareStub());
Expand Down

0 comments on commit fd9f493

Please sign in to comment.