private function setType($type) { Assertion::string($type, 'Token type should be a string'); Assertion::startsWith($type, 'T_', 'Token type should start with T_'); Assertion::true(defined($type), 'Token type should be the name of a defined constant'); $this->type = $type; $this->code = constant($type); }
public function testValidStartsWith() { Assertion::startsWith("foo", "foo"); Assertion::startsWith("foo", "fo"); Assertion::startsWith("foo", "f"); Assertion::startsWith("址foo", "址"); }
/** * @Then the log messages should be shown */ public function theLogMessagesShouldBeShown() { list($line0, $line1) = $this->data['output']; Assertion::startsWith($line0, 'purging database'); Assertion::endsWith($line1, RoleFixture::class); }