/** * @test */ function it_has_models_for_all_builtin_post_types() { $this->assertSame('attachment', \Silk\WordPress\Post\Attachment::postTypeId()); $this->assertSame('nav_menu_item', \Silk\WordPress\Post\NavMenuItem::postTypeId()); $this->assertSame('page', \Silk\WordPress\Post\Page::postTypeId()); $this->assertSame('post', \Silk\WordPress\Post\Post::postTypeId()); $this->assertSame('revision', \Silk\WordPress\Post\Revision::postTypeId()); }
/** * @test * @expectedException \Silk\Post\Exception\ModelPostTypeMismatchException */ function it_blows_up_if_instantiated_with_a_non_page_post_type() { $post_id = $this->factory->post->create(['post_type' => 'post']); // this will blow up since the post id is for a post_type of `post` Page::fromID($post_id); }