public function iAmViewingBlogPost($post_data_or_title)
    {
        // Retrieve the first row only.
        if ($post_data_or_title instanceof TableNode) {
            $post_data_hash = $post_data_or_title->getHash();

            if (count($post_data_hash) > 1) {
                throw new UnexpectedValueException('[W810] "Given I am viewing a post:" step must only contain one post');
            }

            $post = $this->createContent($this->parseArgs($post_data_hash[0]));
        } else {
            $post = $this->getContentFromTitle($post_data_or_title);
        }

        $this->visitPath($post['url']);
    }
public function iAmViewingBlogPost($post_data_or_title)
    {
        // Retrieve the first row only.
        if ($post_data_or_title instanceof TableNode) {
            $post_data_hash = $post_data_or_title->getHash();

            if (count($post_data_hash) > 1) {
                throw new UnexpectedValueException('[W810] "Given I am viewing a post:" step must only contain one post');
            }

            $post = $this->createContent($this->parseArgs($post_data_hash[0]));
        } else {
            $post = $this->getContentFromTitle($post_data_or_title);
        }

        $this->visitPath($post['url']);
    }
public function iAmViewingBlogPost ( $ post_data_or_title ) { // Retrieve the first row only. if ( $ post_data_or_title instanceof TableNode ) { $ post_data_hash = $ post_data_or_title -> getHash ( ) ; if ( count ( $ post_data_hash ) > 1 ) { throw new UnexpectedValueException ( '[W810] "Given I am viewing a post:" step must only contain one post' ) ; } $ post = $ this -> createContent ( $ this -> parseArgs ( $ post_data_hash [ 0 ] ) ) ; } else { $ post = $ this -> getContentFromTitle ( $ post_data_or_title ) ; } $ this -> visitPath ( $ post [ 'url' ] ) ; }
Create content, and go to it in the browser.

Example: Given I am viewing a post:
| post_type | post_title | post_content | post_status |
| page      | Test Post   | Hello World  | publish     |
Example: Given I am viewing the post: "Test Post"

@Given /^(?:I am|they are) viewing (?:a|the)(?: blog)? post(?: "([^"]+)"|:)/

@param TableNode|string $post_data_or_title

@throws \UnexpectedValueException
Create content and go to it in the browser .