Group talk classes into a modules directory

This commit is contained in:
Oliver Davies 2024-08-02 18:35:36 +01:00
parent 5aba021339
commit 2a4247684d
5 changed files with 11 additions and 15 deletions

View file

@ -12,6 +12,6 @@ sculpin_content_types:
permalink: /talks/:basename/ permalink: /talks/:basename/
services: services:
App\Opdavies\TwigExtension\OpdaviesTwigExtension: Modules\Talk\TwigExtension\TalkTwigExtension:
tags: tags:
- {name: twig.extension} - {name: twig.extension}

View file

@ -11,11 +11,7 @@
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"App\\": "src" } "Modules\\": "modules/" }
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests" }
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^11.1" "phpunit/phpunit": "^11.1"

View file

@ -1,19 +1,19 @@
<?php <?php
namespace App\Tests\Opdavies\TwigExtension; namespace Modules\Talk\Tests\TwigExtension;
use App\Opdavies\TwigExtension\OpdaviesTwigExtension;
use Dflydev\DotAccessConfiguration\Configuration; use Dflydev\DotAccessConfiguration\Configuration;
use Modules\Talk\TwigExtension\TalkTwigExtension;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Sculpin\Contrib\ProxySourceCollection\ProxySourceItem; use Sculpin\Contrib\ProxySourceCollection\ProxySourceItem;
class OpdaviesTwigExtensionTest extends TestCase class TalkTwigExtensionTest extends TestCase
{ {
private OpdaviesTwigExtension $extension; private TalkTwigExtension $extension;
public function setUp(): void public function setUp(): void
{ {
$this->extension = new OpdaviesTwigExtension(); $this->extension = new TalkTwigExtension();
} }
public function testNoPastEvents(): void public function testNoPastEvents(): void

View file

@ -1,12 +1,12 @@
<?php <?php
namespace App\Opdavies\TwigExtension; namespace Modules\Talk\TwigExtension;
use Sculpin\Contrib\ProxySourceCollection\ProxySourceItem; use Sculpin\Contrib\ProxySourceCollection\ProxySourceItem;
use Twig\Extension\AbstractExtension; use Twig\Extension\AbstractExtension;
use Twig\TwigFunction; use Twig\TwigFunction;
class OpdaviesTwigExtension extends AbstractExtension class TalkTwigExtension extends AbstractExtension
{ {
public function getFunctions(): array public function getFunctions(): array
{ {

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./vendor/autoload.php" colors="true" stopOnFailure="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.1/phpunit.xsd" cacheDirectory=".phpunit.cache"> <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./vendor/autoload.php" colors="true" stopOnFailure="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.1/phpunit.xsd" cacheDirectory=".phpunit.cache">
<testsuites> <testsuites>
<testsuite name="unit tests"> <testsuite name="Modules">
<directory suffix="Test.php">tests</directory> <directory suffix="Test.php">modules</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
</phpunit> </phpunit>