Rename example to atdc

This commit is contained in:
Oliver Davies 2024-01-27 07:45:05 +00:00 committed by Oliver Davies
parent db36e7a950
commit 3fecd35d1c
17 changed files with 25 additions and 25 deletions

View file

@ -1,7 +1,7 @@
example.blog: atdc.blog:
path: /blog path: /blog
defaults: defaults:
_controller: Drupal\example\Controller\BlogPageController _controller: Drupal\atdc\Controller\BlogPageController
_title: Blog _title: Blog
requirements: requirements:
_permission: access content _permission: access content

View file

@ -1,4 +1,4 @@
services: services:
Drupal\example\Repository\PostNodeRepository: Drupal\atdc\Repository\PostNodeRepository:
arguments: arguments:
- '@entity_type.manager' - '@entity_type.manager'

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Drupal\example\Builder; namespace Drupal\atdc\Builder;
use Drupal\Core\Datetime\DrupalDateTime; use Drupal\Core\Datetime\DrupalDateTime;
use Drupal\node\Entity\Node; use Drupal\node\Entity\Node;

View file

@ -1,9 +1,9 @@
<?php <?php
namespace Drupal\example\Controller; namespace Drupal\atdc\Controller;
use Drupal\atdc\Repository\PostNodeRepository;
use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Controller\ControllerBase;
use Drupal\example\Repository\PostNodeRepository;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
class BlogPageController extends ControllerBase { class BlogPageController extends ControllerBase {

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Drupal\example; namespace Drupal\atdc;
use Drupal\node\NodeInterface; use Drupal\node\NodeInterface;

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Drupal\example\Repository; namespace Drupal\atdc\Repository;
use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\node\NodeInterface; use Drupal\node\NodeInterface;

View file

@ -1,8 +1,8 @@
<?php <?php
namespace Drupal\Tests\example\Functional; namespace Drupal\Tests\atdc\Functional;
use Drupal\example\Builder\PostBuilder; use Drupal\atdc\Builder\PostBuilder;
use Drupal\Tests\BrowserTestBase; use Drupal\Tests\BrowserTestBase;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
@ -13,7 +13,7 @@ class BlogPageTest extends BrowserTestBase {
protected $defaultTheme = 'stark'; protected $defaultTheme = 'stark';
protected static $modules = ['node', 'example']; protected static $modules = ['node', 'atdc'];
public function testBlogPage(): void { public function testBlogPage(): void {
$this->drupalGet('/blog'); $this->drupalGet('/blog');

View file

@ -1,6 +1,6 @@
<?php <?php
namespace Drupal\Tests\example\Functional; namespace Drupal\Tests\atdc\Functional;
use Drupal\Tests\BrowserTestBase; use Drupal\Tests\BrowserTestBase;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;

View file

@ -1,8 +1,8 @@
<?php <?php
namespace Drupal\Tests\example\Kernel\Builder; namespace Drupal\Tests\atdc\Kernel\Builder;
use Drupal\example\Builder\PostBuilder; use Drupal\atdc\Builder\PostBuilder;
use Drupal\KernelTests\Core\Entity\EntityKernelTestBase; use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;
use Drupal\node\NodeInterface; use Drupal\node\NodeInterface;
use Drupal\taxonomy\Entity\Term; use Drupal\taxonomy\Entity\Term;
@ -19,7 +19,7 @@ final class PostBuilderTest extends EntityKernelTestBase {
'taxonomy', 'taxonomy',
// Custom. // Custom.
'example_test', 'atdc_test',
]; ];
/** @test */ /** @test */
@ -51,7 +51,7 @@ final class PostBuilderTest extends EntityKernelTestBase {
$this->installEntitySchema(entity_type_id: 'taxonomy_term'); $this->installEntitySchema(entity_type_id: 'taxonomy_term');
$this->installConfig(modules: [ $this->installConfig(modules: [
'example_test', 'atdc_test',
]); ]);
$node = PostBuilder::create() $node = PostBuilder::create()

View file

@ -1,9 +1,9 @@
<?php <?php
namespace Drupal\Tests\example\Kernel; namespace Drupal\Tests\atdc\Kernel;
use Drupal\example\Builder\PostBuilder; use Drupal\atdc\Builder\PostBuilder;
use Drupal\example\Repository\PostNodeRepository; use Drupal\atdc\Repository\PostNodeRepository;
use Drupal\KernelTests\Core\Entity\EntityKernelTestBase; use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;
use Drupal\node\NodeInterface; use Drupal\node\NodeInterface;
@ -12,7 +12,7 @@ use Drupal\node\NodeInterface;
*/ */
class PostNodeRepositoryTest extends EntityKernelTestBase { class PostNodeRepositoryTest extends EntityKernelTestBase {
protected static $modules = ['node', 'example']; protected static $modules = ['node', 'atdc'];
public function testPostsAreReturnedByCreatedDate(): void { public function testPostsAreReturnedByCreatedDate(): void {
// Arrange. // Arrange.

View file

@ -1,10 +1,10 @@
<?php <?php
namespace Drupal\Tests\example\Unit; namespace Drupal\Tests\atdc\Unit;
use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\example\Repository\PostNodeRepository; use Drupal\atdc\Repository\PostNodeRepository;
use Drupal\node\NodeInterface; use Drupal\node\NodeInterface;
use Drupal\Tests\UnitTestCase; use Drupal\Tests\UnitTestCase;

View file

@ -1,8 +1,8 @@
<?php <?php
namespace Drupal\Tests\example\Unit; namespace Drupal\Tests\atdc\Unit;
use Drupal\example\PostWrapper; use Drupal\atdc\PostWrapper;
use Drupal\node\Entity\Node; use Drupal\node\Entity\Node;
use Drupal\node\NodeInterface; use Drupal\node\NodeInterface;
use Drupal\Tests\UnitTestCase; use Drupal\Tests\UnitTestCase;
@ -14,7 +14,7 @@ final class PostWrapperTest extends UnitTestCase {
/** @test */ /** @test */
public function it_wraps_a_post(): void { public function it_wraps_a_post(): void {
$node = Node::create(['type' => 'post']); $node = $this->createMock(NodeInterface::class);
$node->method('bundle')->willReturn('post'); $node->method('bundle')->willReturn('post');
$wrapper = new PostWrapper($node); $wrapper = new PostWrapper($node);