Admin_Action_Index_Push_Test::testCreateWithSections PHP Метод

testCreateWithSections() публичный Метод

    public function testCreateWithSections()
    {
        $response = $this->dummy_response();
        $api = $this->prophet->prophesize('\\Apple_Push_API\\API');
        $api->post_article_to_channel(Argument::Any(), Argument::Any(), Argument::Any(), array('data' => array('links' => array('sections' => array('http://news-api.apple.com/sections/123')))))->willReturn($response)->shouldBeCalled();
        // Create post
        $post_id = $this->factory->post->create();
        update_post_meta($post_id, 'apple_news_sections', array('http://news-api.apple.com/sections/123'));
        $action = new Push($this->settings, $post_id);
        $action->set_api($api->reveal());
        $action->perform();
        $this->assertEquals($response->data->id, get_post_meta($post_id, 'apple_news_api_id', true));
        $this->assertEquals($response->data->createdAt, get_post_meta($post_id, 'apple_news_api_created_at', true));
        $this->assertEquals($response->data->modifiedAt, get_post_meta($post_id, 'apple_news_api_modified_at', true));
        $this->assertEquals($response->data->shareUrl, get_post_meta($post_id, 'apple_news_api_share_url', true));
        $this->assertEquals(null, get_post_meta($post_id, 'apple_news_api_deleted', true));
    }