assertArrayNotHasKey('customPost', Post::getModels()); } /** * @test */ public function custom_post_type_exists_if_added() { $this->extend((new Extend\Post)->type(PostTestCustomPost::class)); // Needed for extenders to be booted $this->app(); $this->assertArrayHasKey('customPost', Post::getModels()); } } class PostTestCustomPost extends AbstractEventPost implements MergeableInterface { /** * {@inheritdoc} */ public static $type = 'customPost'; /** * {@inheritdoc} */ public function saveAfter(Post $previous = null) { $this->save(); return $this; } }