Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x] Add children tag #8990

Merged
merged 6 commits into from
Dec 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/Tags/ChildrenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
namespace Tests\Tags;

use Facades\Tests\Factories\EntryFactory;
use Mockery;
use Statamic\Facades\Collection;
use Statamic\Facades\Parse;
use Statamic\Facades\Site;
use Statamic\Tags\Children;
use Tests\PreventSavingStacheItemsToDisk;
use Tests\TestCase;

Expand Down Expand Up @@ -80,4 +82,19 @@ public function it_gets_children_data_when_in_another_site()

$this->assertEquals('the french bar entry', $this->tag('{{ children }}{{ title }}{{ /children }}'));
}

/** @test */
public function it_doesnt_affect_children_in_nav()
{
$this->setUpEntries();

$mock = Mockery::mock(Children::class);
$mock->shouldNotReceive('index');
ryanmitchell marked this conversation as resolved.
Show resolved Hide resolved

$this->get('/foo');

$this->assertEquals('the bar entry', $this->tag('{{ nav }}{{ children }}{{ title }}{{ /children }}{{ /nav }}'));

}

}