Skip to content

Commit

Permalink
this way
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Sep 25, 2024
1 parent 8e16fc3 commit 5f51f28
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions tests/Data/Structures/CollectionTreeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@ class CollectionTreeTest extends TestCase
use PreventSavingStacheItemsToDisk;
use UnlinksPaths;

private $directory;

private $stache;

public function setUp(): void
{
parent::setUp();

$this->stache = $this->app->make('stache');
$this->directory = '/path/to/structures/collections';
}

#[Test]
public function it_can_get_and_set_the_handle()
{
Expand Down Expand Up @@ -62,19 +50,15 @@ public function it_gets_the_structure()
#[Test]
public function it_gets_the_path()
{
$this->stache->store('collection-trees')->directory($this->directory);

$collection = Collection::make('pages')->structureContents(['root' => true]);
Collection::shouldReceive('findByHandle')->with('pages')->andReturn($collection);
$tree = $collection->structure()->makeTree('en');
$this->assertEquals('/path/to/structures/collections/pages.yaml', $tree->path());
$this->assertEquals($this->fakeStacheDirectory.'/content/structures/collections/pages.yaml', $tree->path());
}

#[Test]
public function it_gets_the_path_when_using_multisite()
{
$this->stache->store('collection-trees')->directory($this->directory);

$this->setSites([
'one' => ['locale' => 'en_US', 'url' => '/one'],
'two' => ['locale' => 'fr_Fr', 'url' => '/two'],
Expand All @@ -83,7 +67,7 @@ public function it_gets_the_path_when_using_multisite()
$collection = Collection::make('pages')->structureContents(['root' => true]);
Collection::shouldReceive('findByHandle')->with('pages')->andReturn($collection);
$tree = $collection->structure()->makeTree('en');
$this->assertEquals('/path/to/structures/collections/en/pages.yaml', $tree->path());
$this->assertEquals($this->fakeStacheDirectory.'/content/structures/collections/en/pages.yaml', $tree->path());
}

#[Test]
Expand Down

0 comments on commit 5f51f28

Please sign in to comment.