public void All_Tokens_Not_In_PHP_Open_Close_Tags_Returns_Html_Token() { TokenAssert.AreHtmlTokens(new string[] { "+", "&", "&&", "=", "``", ",", "//", "///", "/* comment */", "~", ".=", "--", "/=", "/", ";", "==", "@", ">", ">=", "===", "-" }); }
public void Standard_Open_And_Close_Tags_Returns_OpenTag_And_CloseTag_Tokens() { TokenAssert.IsValid(new TokenPairs { { TokenType.OpenTag, "<?php" }, { TokenType.CloseTag, "?>" } }); }
public void HereDoc_With_Other_Tokens_Returns_HereDocString_Token() { TokenAssert.IsValid(new TokenPairs { { TokenType.OpenTag, "<?" }, { TokenType.HereDocString, "<<<EOT\n//@\n'test'\"value\"<<<\nEOT" }, { TokenType.WhiteSpace, "\n" }, { TokenType.CloseTag, "?>" } }); }
public void Equals_Sign_Returns_AssignmentOperator_Token() { TokenAssert.IsValid(new TokenPairs { { TokenType.OpenTag, "<?" }, { TokenType.WhiteSpace, " " }, { TokenType.AssignmentOperator, "=" }, { TokenType.CloseTag, "?>" } }); }
public void Equals_Equals_Equals_Returns_IdenticalOperator_Token() { TokenAssert.IsValid(new TokenPairs { { TokenType.OpenTag, "<?" }, { TokenType.WhiteSpace, " " }, { TokenType.IdenticalOperator, "===" }, { TokenType.CloseTag, "?>" } }); }
public void Three_Less_Thans_Returns_HereDocString_Token() { TokenAssert.IsValid(new TokenPairs { { TokenType.OpenTag, "<?" }, { TokenType.HereDocString, "<<<EOT\nEOT" }, { TokenType.EndOfStatement, ";" }, { TokenType.CloseTag, "?>" } }); }
public void Print_Addition_Returns_Tokens() { TokenAssert.IsValid(new TokenPairs { { TokenType.OpenTag, "<?php" }, { TokenType.WhiteSpace, " " }, { TokenType.Identifier, "print" }, { TokenType.LeftParenthesis, "(" }, { TokenType.Number, "1" }, { TokenType.AdditionOperator, "+" }, { TokenType.Number, "2" }, { TokenType.RightParenthesis, ")" }, { TokenType.WhiteSpace, " " }, { TokenType.CloseTag, "?>" } }); }
public void Basic_Ternary_Expression_Returns_Tokens() { TokenAssert.IsValid(new TokenPairs { { TokenType.OpenTag, "<?" }, { TokenType.Identifier, "print" }, { TokenType.LeftParenthesis, "(" }, { TokenType.LeftParenthesis, "(" }, { TokenType.Identifier, "true" }, { TokenType.OrOperator, "||" }, { TokenType.Identifier, "false" }, { TokenType.RightParenthesis, ")" }, { TokenType.TernaryOperator, "?" }, { TokenType.String, "'yay'" }, { TokenType.TernaryOperator, ":" }, { TokenType.String, "'nay'" }, { TokenType.RightParenthesis, ")" }, { TokenType.EndOfStatement, ";" }, { TokenType.CloseTag, "?>" } }); }
public void Forward_Slash_Returns_DivisonOperator_Token() { TokenAssert.IsValid(TokenType.DivisionOperator, "/"); }
public void Minus_Sign_Returns_SubtractionOperator_Token() { TokenAssert.IsValid(TokenType.SubtractionOperator, "-"); }
public void Ampersand_Returns_Ampersand_Token() { TokenAssert.IsValid(TokenType.Ampersand, "&"); }
public void Two_Backticks_Returns_BacktickString_Token() { TokenAssert.IsValid(TokenType.BacktickString, "``"); }
public void Two_Ampersands_Returns_AndOperator_Token() { TokenAssert.IsValid(TokenType.AndOperator, "&&"); }
public void Three_Slashes_Returns_Comment_Token() { TokenAssert.IsValid(TokenType.Comment, "///"); }
public void Comma_Returns_Comma_Token() { TokenAssert.IsValid(TokenType.Comma, ","); }
public void Greater_Than_Returns_GreaterThanOperator_Token() { TokenAssert.IsValid(TokenType.GreaterThanOperator, ">"); }
public void Greater_Than_Equals_Returns_GreaterThanOrEqualOperator_Token() { TokenAssert.IsValid(TokenType.GreaterThanOrEqualOperator, ">="); }
public void Plus_Sign_Returns_AdditionOperator_Token() { TokenAssert.IsValid(TokenType.AdditionOperator, "+"); }
public void At_Symbol_Returns_ErrorSuppressor_Token() { TokenAssert.IsValid(TokenType.ErrorSuppressor, "@"); }
public void Simple_Open_Tag_Returns_OpenTag_Token() { TokenAssert.IsValid(new TokenPairs { { TokenType.OpenTag, "<?" } }); }
public void Two_Minuses_Returns_Decrement_Operator_Token() { TokenAssert.IsValid(TokenType.DecrementOperator, "--"); }
public void Period_Equals_Returns_ConcatEqualOperator_Token() { TokenAssert.IsValid(TokenType.ConcatEqualOperator, ".="); }
public void Tilde_Returns_ComplementOperator_Token() { TokenAssert.IsValid(TokenType.ComplementOperator, "~"); }
public void Star_Slash_Returns_Comment_Token() { TokenAssert.IsValid(TokenType.Comment, "/* comment */"); }
public void Standard_Open_Tag_Returns_OpenTag_Token() { TokenAssert.IsValid(new TokenPairs { { TokenType.OpenTag, "<?php" } }); }
public void Semicolon_Returns_EndOfStatement_Token() { TokenAssert.IsValid(TokenType.EndOfStatement, ";"); }