public function testDeletingContainerRemovesFromRegistry() { $this->registry->createContainer('foo'); $this->assertTrue($this->registry->containerExists('foo')); $result = $this->registry->deleteContainer('foo'); $this->assertFalse($this->registry->containerExists('foo')); $this->assertTrue($result); }
/** * Checks whether a placeholder contains data or view variable exists * * @param string $name the name of the placeholder or view variable */ public function has($name) { // check view variables if (isset($this->{$name}) && !empty($this->{$name}) && $this->{$name} != '') { return true; } // check placeholders if ($this->_placeholderRegistry->containerExists($name)) { $value = $this->_placeholderRegistry->getContainer($name)->getValue(); if (is_array($value)) { foreach ($value as $v) { if (!empty($v) && $v != '') { return true; } } } else { if (!empty($value) && $value != '') { return true; } } } return false; }