noHeaders = true; $constraints = array('type' => 'HTML', 'href' => false); $view = array('type' => 'HTML', 'foo' => 'bar'); $this->assertTrue($servlet->checkConstraints($view, $constraints)); $view = array('type' => 'HTML', 'foo' => 'bar', 'href' => ''); $this->assertTrue($servlet->checkConstraints($view, $constraints)); $view = array('type' => 'HTML', 'foo' => 'bar', 'href' => 'blub'); $this->assertFalse($servlet->checkConstraints($view, $constraints)); $view = array('type' => 'URL', 'foo' => 'bar', 'href' => 'blub'); $this->assertFalse($servlet->checkConstraints($view, $constraints)); $view = array('type' => 'URL', 'foo' => 'bar'); $this->assertFalse($servlet->checkConstraints($view, $constraints)); $constraints = array('type' => 'HTML', 'href' => true); $view = array('type' => 'HTML', 'foo' => 'bar'); $this->assertFalse($servlet->checkConstraints($view, $constraints)); $view = array('type' => 'HTML', 'foo' => 'bar', 'href' => ''); $this->assertFalse($servlet->checkConstraints($view, $constraints)); $view = array('type' => 'HTML', 'foo' => 'bar', 'href' => 'blub'); $this->assertTrue($servlet->checkConstraints($view, $constraints)); $view = array('type' => 'URL', 'foo' => 'bar', 'href' => 'blub'); $this->assertFalse($servlet->checkConstraints($view, $constraints)); $view = array('type' => 'URL', 'foo' => 'bar'); $this->assertFalse($servlet->checkConstraints($view, $constraints)); $constraints = array('type' => 'URL'); $view = array('type' => 'HTML', 'foo' => 'bar'); $this->assertFalse($servlet->checkConstraints($view, $constraints)); $view = array('type' => 'HTML', 'foo' => 'bar', 'href' => ''); $this->assertFalse($servlet->checkConstraints($view, $constraints)); $view = array('type' => 'HTML', 'foo' => 'bar', 'href' => 'blub'); $this->assertFalse($servlet->checkConstraints($view, $constraints)); $view = array('type' => 'URL', 'foo' => 'bar', 'href' => 'blub'); $this->assertTrue($servlet->checkConstraints($view, $constraints)); $view = array('type' => 'URL', 'foo' => 'bar'); $this->assertTrue($servlet->checkConstraints($view, $constraints)); } }