/** * @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 */ public function it_has_a_method_for_the_permalink() { $post = $this->factory->post->create_and_get(); $model = Post::fromWpPost($post); $this->assertSame(get_permalink($post->ID), $model->url()); }