Skip to content

Commit

Permalink
Sections > Entries
Browse files Browse the repository at this point in the history
  • Loading branch information
janhenckens committed May 26, 2024
1 parent 5e03878 commit 006b810
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions tests/unit/ConsoleIndexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected function _before()
],
]);

Craft::$app->getSections()->saveSection($section);
Craft::$app->getEntries()->saveSection($section);

$element = new Entry();
$element->siteId = 1;
Expand Down Expand Up @@ -90,8 +90,8 @@ protected function _before()
public function _after()
{
parent::_after(); // TODO: Change the autogenerated stub
$section = Craft::$app->getSections()->getSectionByHandle('news');
Craft::$app->getSections()->deleteSection($section);
$section = Craft::$app->getEntries()->getSectionByHandle('news');
Craft::$app->getEntries()->deleteSection($section);
}

/** @test * */
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/EventHandlersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected function _before()
],
]);

Craft::$app->getSections()->saveSection($section);
Craft::$app->getEntries()->saveSection($section);

$this->section = $section;

Expand Down Expand Up @@ -101,8 +101,8 @@ protected function _before()
public function _after()
{
parent::_after(); // TODO: Change the autogenerated stub
$section = Craft::$app->getSections()->getSectionByHandle('news');
Craft::$app->getSections()->deleteSection($section);
$section = Craft::$app->getEntries()->getSectionByHandle('news');
Craft::$app->getEntries()->deleteSection($section);

$field = Craft::$app->getFields()->getFieldByHandle('entryField');
if ($field) {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/ImportIndexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function it_calls_update_on_the_engine()
],
]);

Craft::$app->getSections()->saveSection($section);
Craft::$app->getEntries()->saveSection($section);

$element = new Entry();
$element->siteId = 1;
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/IndexControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class IndexControllerTest extends Unit

protected function _before()
{
$section = Craft::$app->getSections()->getSectionByHandle('news');
$section = Craft::$app->getEntries()->getSectionByHandle('news');
if ($section) {
Craft::$app->getSections()->deleteSection($section);
Craft::$app->getEntries()->deleteSection($section);
}

parent::_before();
Expand Down Expand Up @@ -63,7 +63,7 @@ protected function _before()
],
]);

Craft::$app->getSections()->saveSection($section);
Craft::$app->getEntries()->saveSection($section);

$element = new Entry();
$element->siteId = 1;
Expand All @@ -82,8 +82,8 @@ protected function _before()
public function _after()
{
parent::_after(); // TODO: Change the autogenerated stub
$section = Craft::$app->getSections()->getSectionByHandle('news');
Craft::$app->getSections()->deleteSection($section);
$section = Craft::$app->getEntries()->getSectionByHandle('news');
Craft::$app->getEntries()->deleteSection($section);
}

/** @test * */
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/ScoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ protected function _before()
],
]);

Craft::$app->getSections()->saveSection($section);
Craft::$app->getEntries()->saveSection($section);

$this->section = $section;
}

public function _after()
{
parent::_after();
$section = Craft::$app->getSections()->getSectionByHandle('news');
Craft::$app->getSections()->deleteSection($section);
$section = Craft::$app->getEntries()->getSectionByHandle('news');
Craft::$app->getEntries()->deleteSection($section);
}

/** @test */
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/SearchableBehaviorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class SearchableBehaviorTest extends Unit
protected function _before()
{
parent::_before();
$section = Craft::$app->getSections()->getSectionByHandle('news');
$section = Craft::$app->getEntries()->getSectionByHandle('news');
if ($section) {
Craft::$app->getSections()->deleteSection($section);
Craft::$app->getEntries()->deleteSection($section);
}

$section = new Section([
Expand All @@ -57,7 +57,7 @@ protected function _before()
],
]);

Craft::$app->getSections()->saveSection($section);
Craft::$app->getEntries()->saveSection($section);

$this->section = $section;

Expand Down Expand Up @@ -114,8 +114,8 @@ protected function _before()
public function _after()
{
parent::_after(); // TODO: Change the autogenerated stub
$section = Craft::$app->getSections()->getSectionByHandle('news');
Craft::$app->getSections()->deleteSection($section);
$section = Craft::$app->getEntries()->getSectionByHandle('news');
Craft::$app->getEntries()->deleteSection($section);

$field = Craft::$app->getFields()->getFieldByHandle('entryField');
if ($field) {
Expand Down

0 comments on commit 006b810

Please sign in to comment.