Example #1
0
 /**
  * Match the opened page to a category
  *
  * @param \XLite\Model\Category $category Category
  *
  * @return void
  * @access protected
  * @since  1.0.0
  */
 protected function doCategoryPageTesting(\XLite\Model\Category $category)
 {
     // Title
     $titleSelector = "h1#page-title.title";
     if ($category->getShowTitle()) {
         $this->assertElementPresent("css={$titleSelector}", "A category title is missing (" . $category->getCategoryId() . ")");
         $title = $this->getJSExpression("jQuery('{$titleSelector}').html()");
         $this->assertEquals($category->getName(), $title, "A category displays a wrong title (" . $category->getCategoryId() . ")");
     } else {
         $this->assertElementNotPresent("css={$titleSelector}", "A category title is exists (" . $category->getCategoryId() . ")");
     }
     // Description
     $method = $category->getDescription() ? "assertElementPresent" : "assertElementNotPresent";
     $this->{$method}("css=.category-description", "Wrong category description ({$method}, " . $category->getCategoryId() . ")");
 }
 /**
  * {@inheritDoc}
  */
 public function getShowTitle()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getShowTitle', array());
     return parent::getShowTitle();
 }