/** * @test */ public function it_can_have_content() { $content = "\n"; $token = TokenBuilder::create('T_WHITESPACE')->setContent($content)->build(); $this->tokenHasContent($content, $token); }
public function tokensProvider() { $tokens = array(TokenBuilder::create('T_OPEN_TAG')->build(), TokenBuilder::create('T_WHITESPACE')->build(), TokenBuilder::create('T_NAMESPACE')->build()); return array(array($tokens, 0, array($tokens[1], $tokens[2])), array($tokens, 1, array($tokens[2])), array($tokens, 2, array())); }
public function tokensProvider() { return array(array(array(new Succeeding(array(new ExactMatch(T_WHITESPACE), new ExactMatch(T_NAMESPACE), new ExactMatch(T_WHITESPACE), new ExactMatch(T_STRING))), new Quantity(new Succeeding(array(new ExactMatch(T_NS_SEPARATOR), new ExactMatch(T_STRING))), null, null), new ExactMatch(T_SEMICOLON)), array(TokenBuilder::create('T_OPEN_TAG')->build(), TokenBuilder::create('T_WHITESPACE')->build(), TokenBuilder::create('T_NAMESPACE')->build(), TokenBuilder::create('T_WHITESPACE')->build(), TokenBuilder::create('T_STRING')->build(), TokenBuilder::create('T_NS_SEPARATOR')->build(), TokenBuilder::create('T_STRING')->build(), TokenBuilder::create('T_NS_SEPARATOR')->build(), TokenBuilder::create('T_STRING')->build(), TokenBuilder::create('T_SEMICOLON')->build()), true)); }
public function tokensProvider() { return array(array(array(new ExactMatch(T_NAMESPACE), new ExactMatch(T_CLASS)), array(TokenBuilder::create('T_WHITESPACE')->build(), TokenBuilder::create('T_NAMESPACE')->build(), TokenBuilder::create('T_WHITESPACE')->build()), 0, false), array(array(new ExactMatch(T_NAMESPACE), new ExactMatch(T_CLASS)), array(TokenBuilder::create('T_WHITESPACE')->build(), TokenBuilder::create('T_NAMESPACE')->build(), TokenBuilder::create('T_CLASS')->build()), 0, true)); }
public function tokensProvider() { return array(array(new ExactMatch(T_WHITESPACE, "\n"), 2, 2, array(TokenBuilder::create('T_OPEN_TAG')->build(), TokenBuilder::create('T_WHITESPACE')->setContent("\n")->build(), TokenBuilder::create('T_WHITESPACE')->setContent("\n")->build()), 0, true), array(new \Matthias\Codesniffer\Sequence\Expectation\ExactMatch(T_WHITESPACE, "\n"), 1, 2, array(TokenBuilder::create('T_OPEN_TAG')->build(), TokenBuilder::create('T_NAMESPACE')->build(), TokenBuilder::create('T_WHITESPACE')->setContent("\n")->build(), TokenBuilder::create('T_CLASS')->build()), 1, true), array(new \Matthias\Codesniffer\Sequence\Expectation\ExactMatch(T_WHITESPACE, "\n"), 2, 2, array(TokenBuilder::create('T_OPEN_TAG')->build(), TokenBuilder::create('T_WHITESPACE')->setContent("\n")->build(), TokenBuilder::create('T_WHITESPACE')->setContent("\n")->build(), TokenBuilder::create('T_WHITESPACE')->setContent("\n")->build()), 0, false), array(new ExactMatch(T_WHITESPACE, "\n"), null, 2, array(TokenBuilder::create('T_OPEN_TAG')->build(), TokenBuilder::create('T_CLASS')->build()), 0, true), array(new \Matthias\Codesniffer\Sequence\Expectation\ExactMatch(T_WHITESPACE, "\n"), 2, null, array(TokenBuilder::create('T_OPEN_TAG')->build(), TokenBuilder::create('T_WHITESPACE')->setContent("\n")->build(), TokenBuilder::create('T_WHITESPACE')->setContent("\n")->build(), TokenBuilder::create('T_WHITESPACE')->setContent("\n")->build(), TokenBuilder::create('T_WHITESPACE')->setContent("\n")->build()), 0, true), array(new \Matthias\Codesniffer\Sequence\Expectation\ExactMatch(T_WHITESPACE, "\n"), 2, null, array(TokenBuilder::create('T_OPEN_TAG')->build(), TokenBuilder::create('T_WHITESPACE')->setContent("\n")->build()), 0, false)); }
private function docCommentNotAtBeginningOfFile() { return array(array(TokenBuilder::create('T_CLASS')->build(), TokenBuilder::create('T_DOC_COMMENT')->build()), 1, false); }
public function tokensProvider() { return array(array(array(TokenBuilder::create('T_OPEN_TAG')->build(), TokenBuilder::create('T_WHITESPACE')->build()), 0, true), array(array(TokenBuilder::create('T_OPEN_TAG')->build(), TokenBuilder::create('T_CLASS')->build()), 0, false), array(array(TokenBuilder::create('T_OPEN_TAG')->build()), 0, false)); }