hasClass('collapsed') != $open; } /** * Set fieldset state. * * @param boolean $open open or not * * @return $this */ public function set($open) { if ($open !== $this->isOpen()) { $this->query('tag:button')->one()->click(); } return $this; } /** * @inheritdoc */ public function getValue() { return $this->isOpen(); } /** * Set fieldset state to open. * * @return $this */ public function open() { return $this->set(true); } /** * Set fieldset state to close. * * @return $this */ public function close() { return $this->set(false); } /** * Get label element. * * @return CElement|CNullElement */ public function getLabel() { return $this->query('xpath:./legend/button/span')->one(false); } /** * Get label text. * * @return string|null */ public function getText() { $label = $this->getLabel(); if ($label->isValid()) { return $label->getText(); } return null; } /** * Alias for set. * @see self::set * * @param boolean $open open or not * * @return $this */ public function fill($open) { return $this->set($open); } }