Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Gummibeer committed Oct 14, 2019
2 parents be47f54 + a21c267 commit 24703cf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Models/Page.php
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Contracts\View\Factory as ViewFactoryContract;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Arr;
use Illuminate\Support\Traits\Macroable;
use RuntimeException;
use Spatie\Feed\FeedItem;
use Spatie\Sheets\Facades\Sheets;
Expand All @@ -16,6 +17,8 @@

class Page implements PageContract
{
use Macroable;

/** @var string|null */
protected $view;

Expand Down
15 changes: 15 additions & 0 deletions tests/Models/PageTest.php
Expand Up @@ -197,4 +197,19 @@ public function it_returns_feed_item_if_page_data_supports_it(): void
static::assertInstanceOf(FeedItem::class, $feedItem);
$feedItem->validate();
}

/** @test */
public function it_is_macroable()
{
$called = false;
$callback = function () use (&$called) {
$called = true;
};

Page::macro('testMacro', $callback);
Page::testMacro();

static::assertTrue(Page::hasMacro('testMacro'));
static::assertTrue($called);
}
}

0 comments on commit 24703cf

Please sign in to comment.