@param string $title

@Given /^(?:|I )should see (?:|an )introduction of (?:|the )"(?P<title>([^"]*))" blog post on the list$/

@return array
974004
public function iShouldSeeAnIntroductionOfBlogPost($title)
    {
        $post = $this->findPostByTitle($title);
        $excerpt = str_replace('"', '\\"', $post['post_content']);
        $excerptBeforeMore = substr($excerpt, 0, strpos($excerpt, '<!--more-->'));
        $excerptAfterMore = substr($excerpt, strpos($excerpt, '<!--more-->'));

        return array(
            new Then(sprintf('I should see "%s" as an excerpt of the "%s" blog post', $excerptBeforeMore, $title)),
            new Then(sprintf('I should not see "%s" as an excerpt of the "%s" blog post', $excerptAfterMore, $title))
        );
    }
862474
public function add_module($title) {
        $this->resource_count++;
        $resource_str = str_pad($this->resource_count.'',6,'0',STR_PAD_LEFT);
        $identifier = 'T_'.$resource_str;

        $xpath = new \DOMXpath($this);

        $items = $xpath->query(CC::item_xpath)->item(0);
        $module = $this->add_child_ns(CC::CC_1_1_CP, $items, 'item', null, array('identifier' => $identifier));
        $new_title = $this->add_child_ns(CC::CC_1_1_CP, $module, 'title', $title);
        return $module;
    }
785619
public function createNode($title = null)
	{
		$node = new Node\ArrayNode();
		$node->setNodeTitle($title);
		$this->add($node);
		
		return $node;
	}
1305552
public function DisplayPostsByTag($title)
    {
        // Get the category
        // Please note that the categories table does *NOT* have a "slug" field!
        $tag = $this->repository->findTagIdByTitle($title);

        // if category does not exist
        if (count($tag) < 1 ) {
            return redirect('home');
        }


        // Process the tag's image

        // (i) resize the category image
        $this->imagesHelper->tagResizedImageFiles(Config::get('lasallecmsfrontend.default_tag_image'));

        // (ii) what is the name of the resized category image that the view will use?
        //      yeah, do this second as about to change $category->featured_image
        $tag->featured_image = $this->imagesHelper->tagImageResizedFilename(Config::get('lasallecmsfrontend.default_tag_image'));

        // Get the posts associated with this category
        $posts = $this->repository->findEnabledAllPostsThatHaveTagId($tag->id);

        if ($posts == 0)
        {
            // There are no enabled posts publish_on =< today
            //return view('errors/404');
            return redirect('home');
        }

        // Is the featured image in each post resized?
        $this->checkPostsImagesResized($posts);

        return view('tags/list_posts_associated_with_tag', [
            'tag'               => $tag,
            'posts'             => $posts,
            'pagetitle'         => $tag->title,
            'DatesHelper'       => DatesHelper::class,
            'HTMLHelper'        => HTMLHelper::class,
            'ImagesHelper'      => $this->imagesHelper,
        ]);
    }
870738
public function set_title($title) {
        $xpath = new \DOMXpath($this);
        $general = $xpath->query(CC::lom_general_xpath)->item(0);
        $new_title = $this->add_child_ns(CC::LOMIMSCC_NS, $general, 'title');
        $new_string = $this->add_child_ns(CC::LOMIMSCC_NS, $new_title, 'string', $title, array("language" => "en-US"));
    }
937696
public function getTabByTitle($title)
    {
        foreach ($this->tabs as $key => $tab) {
            if ($tab->getTitle() === $title) {
                return $this->tabs[$key];
            }
        }

        return null;
    }
309441
public function createTitle($title)
    {
        $item = $this->list->createList($title);
        $item->attributes->addAttributeClass('menu-title');

        return $item;
    }
473545
public function set_title($title) {
        $title = format_string($title);
        $title = strip_tags($title);
        $title = str_replace('"', '&quot;', $title);
        $this->_title = $title;
    }
412163
public function add($title)
    {
        $item = $this->menu->addItem($title);
        $item->parent_id = $this->id;
        $item->parent = $this;

        return $item;
    }
63572
public function getByTitle($title)
    {
        return new View(
            $this->getContext(),
            new ResourcePathServiceOperation($this->getContext(),$this->getResourcePath(),"getByTitle",array(rawurlencode($title)))
        );
    }
648190
protected function _generateListGroupText($title)
    {
        if (is_array($title)) {
            $text = '';
            if (!empty($title['header'])) {
                $text .= $this->tag('h4', $title['header'], ['class' => 'list-group-item-heading']);
            }
            if (!empty($title['text'])) {
                $text .= $this->para('list-group-item-text', $title['text']);
            }
        } else {
            $text = $title;
        }
        return $text;
    }
1271479
public function readByTitle($title) {
        $result = $this->api->request(
            'cmdb.object_types',
            [
                'filter' => [
                    'title' => $title
                ],
                'countobjects' => true
            ]
        );

        return end($result);
    }
426510
public function setTitle($title) {
        $this->title = $title;
        \LaraPageHead::addMetaProperty('og:title', $title);
        \LaraPageHead::addMetaName('twitter:title', $title);

        return $this;
    }
794201
public static function filterTitle(string $title): string
    {
        $title = html_entity_decode($title);
        $title = static::filterPunctuation($title);
        $title = preg_replace('#[^=\x20-\x3B\x3F-\x7E\xA0\x{400}-\x{45F}]+#u', ' ', $title);
        $title = preg_replace('# {2,}#', ' ', $title);

        return trim($title);
    }
466678
public function setTitle($title)
    {
        // Check if title already exists
        $headTitle = $this->selectElement('title')->item(0);
        if (!is_null($headTitle)) {
            $headTitle_new = $this->create('title', $title);
            $headTitle->parentNode->replaceChild($headTitle_new, $headTitle);
        } else {
            $headTitle = $this->create('title', $title);
            $this->appendToHead($headTitle);
        }

        return $this;
    }
1049930
public function collectionToArray($collection, $title = 'title')
     {
         $array = array();
         foreach ($collection as $item) {
             $getter = 'get'.ucfirst($title);
             $array[$item->getId()] = $item->$getter();
         }

         return $array;
     }
559656
public function iClickTheTitleOnTheBlogPostList($title)
    {
        $node = $this->getSession()->getPage()->find('xpath', sprintf('//h2[contains(., "%s")]/a', $title));

        if (is_null($node)) {
            throw new ElementNotFoundException($this->getSession(), 'Blog post title');
        }

        $node->click();
    }