Rename custom module directories
- Rename `opdavies_blog` to `blog`. - Rename `opdavies_blog_test` to `blog_test`. - Rename `opdavies_talks` to `talks`. - Rename `opdavies_talks_test` to `talks_test`. The files within the directories haven't changed, so there is no breaking change caused by renaming the directories. Please enter the commit message for your changes. Lines starting
This commit is contained in:
parent
d7d5a6c8a3
commit
cbe60209e6
59 changed files with 0 additions and 0 deletions
|
@ -1,66 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types = 1);
|
||||
|
||||
namespace Drupal\Tests\opdavies_talks\Kernel;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Drupal\node\NodeInterface;
|
||||
use Drupal\opdavies_talks\Service\TalkCounter;
|
||||
use PHPUnit\Framework\Assert;
|
||||
|
||||
class CountPreviousTalksTest extends TalksTestBase {
|
||||
|
||||
private TalkCounter $talkCounter;
|
||||
|
||||
/** @test */
|
||||
public function previous_talks_are_counted(): void {
|
||||
$this->createTalk([
|
||||
'field_events' => [
|
||||
$this->createEvent(),
|
||||
$this->createEvent(),
|
||||
],
|
||||
]);
|
||||
|
||||
$this->createTalk([
|
||||
'field_events' => [
|
||||
$this->createEvent(),
|
||||
],
|
||||
]);
|
||||
|
||||
Assert::assertSame(3, $this->talkCounter->getCount());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function future_talks_are_not_counted(): void {
|
||||
$this->createTalk([
|
||||
'field_events' => [
|
||||
$this->createEvent([
|
||||
'field_date' => Carbon::now()->subDay(),
|
||||
]),
|
||||
$this->createEvent([
|
||||
'field_date' => Carbon::now()->addDay(),
|
||||
]),
|
||||
],
|
||||
]);
|
||||
|
||||
Assert::assertSame(1, $this->talkCounter->getCount());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function unpublished_talks_are_not_counted(): void {
|
||||
$this->createTalk([
|
||||
'field_events' => [$this->createEvent()],
|
||||
'status' => NodeInterface::NOT_PUBLISHED,
|
||||
]);
|
||||
|
||||
Assert::assertSame(0, $this->talkCounter->getCount());
|
||||
}
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$this->talkCounter = $this->container->get(TalkCounter::class);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue