/** * @param Placeholder $placeholder */ public function append($placeholder) { /** * @var $thisPlaceholder Placeholder */ foreach ($this as &$thisPlaceholder) { if (strtolower($thisPlaceholder->getName()) == strtolower($placeholder->getName())) { $thisPlaceholder = $placeholder; return; } } parent::append($placeholder); }
public function testValidate() { $this->assertTrue(Placeholder::validate("FOO")); $this->assertTrue(Placeholder::validate("bar")); $this->assertTrue(Placeholder::validate("fooBar")); $this->assertTrue(Placeholder::validate("foo-bar")); $this->assertTrue(Placeholder::validate("foo_bar")); $this->assertFalse(Placeholder::validate("foo+bar")); $this->assertFalse(Placeholder::validate("foo~bar")); $this->assertFalse(Placeholder::validate("Foo!Bar")); }