diff --git a/src/Phug/Ast/Ast/Node.php b/src/Phug/Ast/Ast/Node.php index 8b646c30..5dbdc8e9 100644 --- a/src/Phug/Ast/Ast/Node.php +++ b/src/Phug/Ast/Ast/Node.php @@ -370,7 +370,6 @@ public function findChildren(callable $callback, $depth = null, $level = null) $level = $level ?: 0; foreach ($this->children as $child) { - /** @var NodeInterface $child */ if ($child->is($callback)) { yield $child; diff --git a/src/Phug/Compiler/Compiler/NodeCompiler/AssignmentNodeCompiler.php b/src/Phug/Compiler/Compiler/NodeCompiler/AssignmentNodeCompiler.php index 3048ce6c..74df6392 100644 --- a/src/Phug/Compiler/Compiler/NodeCompiler/AssignmentNodeCompiler.php +++ b/src/Phug/Compiler/Compiler/NodeCompiler/AssignmentNodeCompiler.php @@ -8,7 +8,6 @@ use Phug\Parser\Node\AssignmentNode; use Phug\Parser\Node\AttributeNode; use Phug\Parser\NodeInterface; -use Phug\Util\AttributesStorage; use Phug\Util\OrderableInterface; use SplObjectStorage; diff --git a/src/Phug/Compiler/Compiler/NodeCompiler/AttributeNodeCompiler.php b/src/Phug/Compiler/Compiler/NodeCompiler/AttributeNodeCompiler.php index 76bfb299..896c9145 100644 --- a/src/Phug/Compiler/Compiler/NodeCompiler/AttributeNodeCompiler.php +++ b/src/Phug/Compiler/Compiler/NodeCompiler/AttributeNodeCompiler.php @@ -9,7 +9,6 @@ use Phug\Formatter\ElementInterface; use Phug\Parser\Node\AttributeNode; use Phug\Parser\NodeInterface; -use Phug\Util\OrderableInterface; class AttributeNodeCompiler extends AbstractNodeCompiler { diff --git a/src/Phug/Compiler/Compiler/NodeCompilerInterface.php b/src/Phug/Compiler/Compiler/NodeCompilerInterface.php index ae9a5d6e..1522f816 100644 --- a/src/Phug/Compiler/Compiler/NodeCompilerInterface.php +++ b/src/Phug/Compiler/Compiler/NodeCompilerInterface.php @@ -11,7 +11,7 @@ interface NodeCompilerInterface { /** - * @param $nodeList + * @param $nodeList * @param ElementInterface $parent * * @return array diff --git a/src/Phug/Formatter/Formatter/AbstractFormat.php b/src/Phug/Formatter/Formatter/AbstractFormat.php index 963297f4..10fa316d 100644 --- a/src/Phug/Formatter/Formatter/AbstractFormat.php +++ b/src/Phug/Formatter/Formatter/AbstractFormat.php @@ -233,7 +233,7 @@ protected function getDebugInfo($element) /** * @param string|ElementInterface $element * @param bool $noDebug - * @param $element + * @param $element * * @return string */ @@ -460,13 +460,16 @@ protected function formatDynamicValue($formattedName, $value) return 'null'; } - if ($value instanceof ExpressionElement && - in_array(($code = strtolower($value->getValue())), ['true', 'false', 'null', 'undefined']) - ) { - return $code; + if ($value instanceof ExpressionElement) { + $code = strtolower($value->getValue()); + + if (in_array($code, ['true', 'false', 'null', 'undefined'])) { + return $code; + } } $code = $this->formatAssignmentValue($value); + if ($value instanceof ExpressionElement && $value->isEscaped()) { return $this->exportHelper('array_escape', [$formattedName, $code]); } diff --git a/src/Phug/Formatter/Formatter/Format/XmlFormat.php b/src/Phug/Formatter/Formatter/Format/XmlFormat.php index c4da4062..923f539f 100644 --- a/src/Phug/Formatter/Formatter/Format/XmlFormat.php +++ b/src/Phug/Formatter/Formatter/Format/XmlFormat.php @@ -559,7 +559,7 @@ protected function formatMarkupElement(MarkupElement $element) /** * @param AssignmentContainerInterface|AttributesInterface|mixed $markup - * @param Closure(OrderedValue, OrderedValue): int $sorter + * @param Closure(OrderedValue, OrderedValue): int $sorter * * @return list */ diff --git a/src/Phug/Formatter/Formatter/Partial/AssignmentHelpersTrait.php b/src/Phug/Formatter/Formatter/Partial/AssignmentHelpersTrait.php index 93c87071..f5ec8c3b 100644 --- a/src/Phug/Formatter/Formatter/Partial/AssignmentHelpersTrait.php +++ b/src/Phug/Formatter/Formatter/Partial/AssignmentHelpersTrait.php @@ -37,7 +37,7 @@ function ($attributeAssignments) { return function (&$attributes, $name, $value) use ($attributeAssignments) { if (isset($name) && $name !== '') { $result = $attributeAssignments($attributes, $name, $value); - if (($result !== null && $result !== false && ($result !== '' || $name !== 'class'))) { + if ($result !== null && $result !== false && ($result !== '' || $name !== 'class')) { $attributes[$name] = $result; } } diff --git a/src/Phug/Lexer/Lexer/State.php b/src/Phug/Lexer/Lexer/State.php index c7f0d054..a1c7f5a2 100644 --- a/src/Phug/Lexer/Lexer/State.php +++ b/src/Phug/Lexer/Lexer/State.php @@ -241,7 +241,6 @@ public function scan($scanners, array $options = []) $scanners = $this->filterScanners($scanners); foreach ($scanners as $scanner) { - /** @var ScannerInterface $scanner */ $success = false; foreach ($scanner->scan($this, $options) as $token) { @@ -267,7 +266,7 @@ public function scan($scanners, array $options = []) * If the second argument is true, it will throw an exception if none of the scanners * produced any valid tokens. The reading also stops when the end of the input as been reached. * - * @param $scanners + * @param $scanners * @param bool $required * * @throws LexerException @@ -346,9 +345,9 @@ public function createToken($className) * in scanners as you can simply return it's value without having to check for it to be null. * * - * @param $className - * @param $pattern - * @param null $modifiers + * @param class-string $className + * @param string $pattern + * @param string|null $modifiers * * @return iterable */ diff --git a/src/Phug/Parser/Parser.php b/src/Phug/Parser/Parser.php index bca4a48f..1f807255 100644 --- a/src/Phug/Parser/Parser.php +++ b/src/Phug/Parser/Parser.php @@ -330,8 +330,8 @@ public function parse($input, $path = null) foreach ($expandingNodes as $expandingNode) { $current = $expandingNode; - while ($outerNode = $expandingNode->getOuterNode()) { + while ($outerNode = $expandingNode->getOuterNode()) { /** @var NodeInterface $expandedNode */ $expandedNode = $outerNode; $current->setOuterNode(null); diff --git a/src/Phug/Parser/Parser/Event/NodeEvent.php b/src/Phug/Parser/Parser/Event/NodeEvent.php index 9502eb0c..e45ca7ab 100644 --- a/src/Phug/Parser/Parser/Event/NodeEvent.php +++ b/src/Phug/Parser/Parser/Event/NodeEvent.php @@ -4,6 +4,7 @@ use Phug\Event; use Phug\Parser\NodeInterface; +use Phug\ParserEvent; class NodeEvent extends Event { @@ -12,8 +13,8 @@ class NodeEvent extends Event /** * NodeEvent constructor. * - * @param $name - * @param NodeInterface $node + * @param ParserEvent::* $name + * @param NodeInterface $node */ public function __construct($name, NodeInterface $node) { diff --git a/src/Phug/Reader/Reader.php b/src/Phug/Reader/Reader.php index 5cc93461..8b28ba24 100644 --- a/src/Phug/Reader/Reader.php +++ b/src/Phug/Reader/Reader.php @@ -313,9 +313,9 @@ public function peek($length = null, $start = null) * * Notice that ^ is automatically prepended to the pattern. * - * @param string $pattern the regular expression without slashes or modifiers. - * @param string $modifiers the modifiers for the regular expression. - * @param string $ignoredSuffixes characters that are scanned, but don't end up in the consume length. + * @param string $pattern the regular expression without slashes or modifiers. + * @param string|null $modifiers the modifiers for the regular expression. + * @param string|null $ignoredSuffixes characters that are scanned, but don't end up in the consume length. * * @throws ReaderException * diff --git a/src/Phug/Renderer/Renderer/CacheInterface.php b/src/Phug/Renderer/Renderer/CacheInterface.php index c1968eca..d7260197 100644 --- a/src/Phug/Renderer/Renderer/CacheInterface.php +++ b/src/Phug/Renderer/Renderer/CacheInterface.php @@ -11,7 +11,7 @@ interface CacheInterface /** * Return the cached file path after cache optional process. * - * @param $path + * @param string $path * @param string $input pug input * @param callable $rendered method to compile the source into PHP * @param bool $success diff --git a/src/Phug/Renderer/Renderer/Partial/Debug/DebuggerTrait.php b/src/Phug/Renderer/Renderer/Partial/Debug/DebuggerTrait.php index fe5c1aec..42a69d84 100644 --- a/src/Phug/Renderer/Renderer/Partial/Debug/DebuggerTrait.php +++ b/src/Phug/Renderer/Renderer/Partial/Debug/DebuggerTrait.php @@ -180,6 +180,7 @@ private function getRendererException($error, $code, $line, $offset, $source, $s /** * @return bool + * * @codeCoverageIgnore */ private function hasColorSupport() @@ -200,6 +201,7 @@ private function hasColorSupport() /** * @return bool + * * @codeCoverageIgnore */ private function hasStdOutVt100Support() @@ -211,6 +213,7 @@ private function hasStdOutVt100Support() /** * @return bool + * * @codeCoverageIgnore */ private function isStdOutATTY() diff --git a/src/Phug/Renderer/Renderer/Profiler/LinkDump.php b/src/Phug/Renderer/Renderer/Profiler/LinkDump.php index 28388312..65897c34 100644 --- a/src/Phug/Renderer/Renderer/Profiler/LinkDump.php +++ b/src/Phug/Renderer/Renderer/Profiler/LinkDump.php @@ -33,11 +33,11 @@ private function initProperties($name, $events) foreach ([ ['current', EndLexEvent::class, 'lexing', [ 'background' => '#7200c4', - 'color' => 'white', + 'color' => 'white', ]], ['current', HtmlEvent::class, 'rendering', [ 'background' => '#648481', - 'color' => 'white', + 'color' => 'white', ]], ['previous', CompileEvent::class, '%s', [ 'background' => '#ffff78', diff --git a/src/Phug/Util/Util/OrderedValue.php b/src/Phug/Util/Util/OrderedValue.php index ef11b69d..897f9c5f 100644 --- a/src/Phug/Util/Util/OrderedValue.php +++ b/src/Phug/Util/Util/OrderedValue.php @@ -9,6 +9,7 @@ * Class OrderedValue. * * @template T + * * @template-implements ValueTrait */ class OrderedValue implements OrderableInterface diff --git a/src/Phug/Util/Util/Partial/OrderTrait.php b/src/Phug/Util/Util/Partial/OrderTrait.php index fd30a142..72a73398 100644 --- a/src/Phug/Util/Util/Partial/OrderTrait.php +++ b/src/Phug/Util/Util/Partial/OrderTrait.php @@ -2,10 +2,6 @@ namespace Phug\Util\Partial; -use ArrayAccess; -use ArrayObject; -use Phug\Util\Collection; - trait OrderTrait { /** diff --git a/tests/Phug/AbstractCompilerTest.php b/tests/Phug/AbstractCompilerTest.php index 259d51e2..2dab4758 100644 --- a/tests/Phug/AbstractCompilerTest.php +++ b/tests/Phug/AbstractCompilerTest.php @@ -78,7 +78,6 @@ protected function enableJsPhpize() }); $compiler->attach(CompilerEvent::OUTPUT, function (Compiler\Event\OutputEvent $event) use ($compiler) { - /** @var JsPhpize $jsPhpize */ $jsPhpize = $compiler->getOption('jsphpize_engine'); $dependencies = $jsPhpize->compileDependencies(); diff --git a/tests/Phug/Adapter/FileAdapterTest.php b/tests/Phug/Adapter/FileAdapterTest.php index a3b81851..e4746127 100644 --- a/tests/Phug/Adapter/FileAdapterTest.php +++ b/tests/Phug/Adapter/FileAdapterTest.php @@ -575,7 +575,9 @@ public function testCacheRenderString() * @covers \Phug\Renderer\Adapter\FileAdapter::cacheDirectory * @covers \Phug\Renderer\Adapter\FileAdapter::getCacheDirectory * @covers \Phug\Renderer\Partial\Debug\DebuggerTrait::getDebuggedException + * * @expectedException \RuntimeException + * * @expectedExceptionCode 5 */ public function testMissingDirectory() @@ -594,7 +596,9 @@ public function testMissingDirectory() * @covers \Phug\Renderer\Adapter\FileAdapter::cacheDirectory * @covers \Phug\Renderer\Adapter\FileAdapter::cache * @covers \Phug\Renderer\Adapter\FileAdapter::displayCached + * * @expectedException \RuntimeException + * * @expectedExceptionCode 6 */ public function testReadOnlyDirectory() diff --git a/tests/Phug/Ast/NodeTest.php b/tests/Phug/Ast/NodeTest.php index 4e2f66b0..ffc8e10b 100644 --- a/tests/Phug/Ast/NodeTest.php +++ b/tests/Phug/Ast/NodeTest.php @@ -282,6 +282,7 @@ public function testGetChildAt() /** * @covers ::getChildAt + * * @expectedException \Phug\AstException */ public function testGetChildAtWithInvalidOffset() @@ -309,6 +310,7 @@ public function testRemoveChildAt() /** * @covers ::removeChildAt + * * @expectedException \Phug\AstException */ public function testRemoveChildAtWithInvalidOffset() @@ -447,7 +449,9 @@ public function testFindChildren() /** * @covers ::insertBefore + * * @expectedException \Phug\AstException + * * @expectedExceptionMessage Failed to insert before: Passed child is not a child of element to insert in */ public function testInsertBeforeWithBadSibling() @@ -481,7 +485,9 @@ public function testInsertBefore() /** * @covers ::insertAfter + * * @expectedException \Phug\AstException + * * @expectedExceptionMessage Failed to insert after: Passed child is not a child of element to insert in */ public function testInsertAfterWithBadSibling() @@ -562,7 +568,9 @@ public function testGetIterator() /** * @covers ::offsetSet + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage Argument 2 passed to Node->offsetSet needs to be instance of Phug\Ast\NodeInterface */ public function testOffsetSetInvalidArgument() diff --git a/tests/Phug/CasesTest.php b/tests/Phug/CasesTest.php index c5fa5911..bedb87b6 100644 --- a/tests/Phug/CasesTest.php +++ b/tests/Phug/CasesTest.php @@ -21,7 +21,9 @@ public function caseProvider() /** * @group cases + * * @dataProvider caseProvider + * * @covers ::compileFile * @covers ::render */ diff --git a/tests/Phug/CliTest.php b/tests/Phug/CliTest.php index f372fbb8..fe5d98e7 100644 --- a/tests/Phug/CliTest.php +++ b/tests/Phug/CliTest.php @@ -44,6 +44,7 @@ public function finishTest() /** * @group cli + * * @covers ::getCustomMethods */ public function testGetCustomMethods() @@ -73,6 +74,7 @@ public function testGetCustomMethods() /** * @group cli + * * @covers ::convertToKebabCase * @covers ::convertToCamelCase * @covers ::getNamedArgumentBySpaceDelimiter @@ -104,6 +106,7 @@ public function testRun() /** * @group cli + * * @covers ::convertToKebabCase * @covers ::convertToCamelCase * @covers ::execute @@ -158,6 +161,7 @@ public function testListAvailableMethods() /** * @group cli + * * @covers ::convertToKebabCase * @covers ::convertToCamelCase * @covers ::execute @@ -175,6 +179,7 @@ public function testCallableActions() /** * @group cli + * * @covers ::convertToKebabCase * @covers ::convertToCamelCase * @covers ::getNamedArgumentBySpaceDelimiter @@ -196,6 +201,7 @@ public function testOptions() /** * @group cli + * * @covers ::convertToKebabCase * @covers ::convertToCamelCase * @covers ::getNamedArgumentBySpaceDelimiter @@ -258,6 +264,7 @@ public function testCacheDirectory() /** * @group cli + * * @covers ::convertToKebabCase * @covers ::convertToCamelCase * @covers ::getNamedArgumentBySpaceDelimiter @@ -298,6 +305,7 @@ public function testBootstrap() /** * @group cli + * * @covers ::convertToKebabCase * @covers ::convertToCamelCase * @covers ::getNamedArgumentBySpaceDelimiter diff --git a/tests/Phug/Compiler/NodeCompiler/AssignmentListNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/AssignmentListNodeCompilerTest.php index b12ea5c1..eff2aac7 100644 --- a/tests/Phug/Compiler/NodeCompiler/AssignmentListNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/AssignmentListNodeCompilerTest.php @@ -25,6 +25,7 @@ public function testCompileNode() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/AssignmentNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/AssignmentNodeCompilerTest.php index aa54dc94..3e449fae 100644 --- a/tests/Phug/Compiler/NodeCompiler/AssignmentNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/AssignmentNodeCompilerTest.php @@ -46,6 +46,7 @@ public function testCompile() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/AttributeListCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/AttributeListCompilerTest.php index ea1009dd..fecf17cb 100644 --- a/tests/Phug/Compiler/NodeCompiler/AttributeListCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/AttributeListCompilerTest.php @@ -25,6 +25,7 @@ public function testCompileNode() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/AttributeNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/AttributeNodeCompilerTest.php index 7b792a81..c4b4be1c 100644 --- a/tests/Phug/Compiler/NodeCompiler/AttributeNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/AttributeNodeCompilerTest.php @@ -77,6 +77,7 @@ public function testUnescapedAttributes() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() @@ -92,6 +93,7 @@ public function testException() /** * @covers ::compileValue + * * @expectedException \Phug\CompilerException */ public function testAttributeException() diff --git a/tests/Phug/Compiler/NodeCompiler/BlockNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/BlockNodeCompilerTest.php index 13079f54..fd8b3fcf 100644 --- a/tests/Phug/Compiler/NodeCompiler/BlockNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/BlockNodeCompilerTest.php @@ -38,6 +38,7 @@ public function testBlock() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() @@ -53,6 +54,7 @@ public function testException() /** * @covers \Phug\Compiler::compileBlocks + * * @expectedException \Phug\CompilerException */ public function testCompileBlocksException() diff --git a/tests/Phug/Compiler/NodeCompiler/CaseNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/CaseNodeCompilerTest.php index 9b0198e6..093bc3d8 100644 --- a/tests/Phug/Compiler/NodeCompiler/CaseNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/CaseNodeCompilerTest.php @@ -73,6 +73,7 @@ public function testCompile() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/CodeNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/CodeNodeCompilerTest.php index bfab52f4..c81d9184 100644 --- a/tests/Phug/Compiler/NodeCompiler/CodeNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/CodeNodeCompilerTest.php @@ -49,6 +49,7 @@ public function testCompile() /** * @covers :: * @covers ::getCodeElement + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/CommentNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/CommentNodeCompilerTest.php index b7862d1f..88969280 100644 --- a/tests/Phug/Compiler/NodeCompiler/CommentNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/CommentNodeCompilerTest.php @@ -30,6 +30,7 @@ public function testCompile() /** * @covers :: * @covers \Phug\CompilerException:: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/ConditionalNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/ConditionalNodeCompilerTest.php index 90918140..fc4b717f 100644 --- a/tests/Phug/Compiler/NodeCompiler/ConditionalNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/ConditionalNodeCompilerTest.php @@ -62,6 +62,7 @@ public function testCompile() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/DoNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/DoNodeCompilerTest.php index a30d99ea..82f819fa 100644 --- a/tests/Phug/Compiler/NodeCompiler/DoNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/DoNodeCompilerTest.php @@ -14,6 +14,7 @@ class DoNodeCompilerTest extends AbstractCompilerTest { /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/DoctypeNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/DoctypeNodeCompilerTest.php index a4971c8c..b01ffc4f 100644 --- a/tests/Phug/Compiler/NodeCompiler/DoctypeNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/DoctypeNodeCompilerTest.php @@ -29,6 +29,7 @@ public function testCompile() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/DocumentNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/DocumentNodeCompilerTest.php index 6ca2cb58..84679aa7 100644 --- a/tests/Phug/Compiler/NodeCompiler/DocumentNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/DocumentNodeCompilerTest.php @@ -22,6 +22,7 @@ public function testCompile() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/EachNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/EachNodeCompilerTest.php index 54b51035..17760076 100644 --- a/tests/Phug/Compiler/NodeCompiler/EachNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/EachNodeCompilerTest.php @@ -210,6 +210,7 @@ public function testCompileVariablesScope() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/ElementNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/ElementNodeCompilerTest.php index 22157af5..d32731a1 100644 --- a/tests/Phug/Compiler/NodeCompiler/ElementNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/ElementNodeCompilerTest.php @@ -36,6 +36,7 @@ public function testExpansionCompile() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/ExpressionNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/ExpressionNodeCompilerTest.php index 53179fb2..054e2ec6 100644 --- a/tests/Phug/Compiler/NodeCompiler/ExpressionNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/ExpressionNodeCompilerTest.php @@ -29,6 +29,7 @@ public function testCompile() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/FilterNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/FilterNodeCompilerTest.php index 40d4ce22..f3718232 100644 --- a/tests/Phug/Compiler/NodeCompiler/FilterNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/FilterNodeCompilerTest.php @@ -97,6 +97,7 @@ public function testLegacyFilters() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testWrongFilterException() @@ -164,6 +165,7 @@ public function testFilterCompilerArgument() /** * @covers ::compileText + * * @expectedException \Phug\CompilerException */ public function testFilterChildrenException() @@ -192,6 +194,7 @@ public function testFilterChildrenException() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/ImportNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/ImportNodeCompilerTest.php index 25282c66..a7ef86b1 100644 --- a/tests/Phug/Compiler/NodeCompiler/ImportNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/ImportNodeCompilerTest.php @@ -15,6 +15,7 @@ class ImportNodeCompilerTest extends AbstractCompilerTest { /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() @@ -294,6 +295,7 @@ public function testNestedIncludedMixins() /** * @covers \Phug\Compiler::compileIntoElement + * * @expectedException \Phug\CompilerException */ public function testCompileIntoElementException() @@ -345,6 +347,7 @@ public function testNotFoundTemplate() /** * @covers \Phug\Compiler::throwException + * * @expectedException \Phug\CompilerException */ public function testFileNotFoundInFileException() diff --git a/tests/Phug/Compiler/NodeCompiler/KeywordNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/KeywordNodeCompilerTest.php index f3db6b64..dd04aacb 100644 --- a/tests/Phug/Compiler/NodeCompiler/KeywordNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/KeywordNodeCompilerTest.php @@ -48,6 +48,7 @@ public function testCompile() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/MixinCallNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/MixinCallNodeCompilerTest.php index 41666d56..9045de1b 100644 --- a/tests/Phug/Compiler/NodeCompiler/MixinCallNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/MixinCallNodeCompilerTest.php @@ -16,6 +16,7 @@ class MixinCallNodeCompilerTest extends AbstractCompilerTest { /** * @group mixins + * * @covers :: * @covers \Phug\Compiler\NodeCompiler\BlockNodeCompiler:: * @covers \Phug\Compiler\NodeCompiler\BlockNodeCompiler::compileAnonymousBlock @@ -54,6 +55,7 @@ public function testCompile() /** * @group mixins + * * @covers :: */ public function testCompileNestedMixins() @@ -82,6 +84,7 @@ public function testCompileNestedMixins() /** * @group mixins + * * @covers :: */ public function testCompileVariadicMixin() @@ -104,6 +107,7 @@ public function testCompileVariadicMixin() /** * @group mixins + * * @covers :: * @covers \Phug\Compiler\NodeCompiler\BlockNodeCompiler:: * @covers \Phug\Compiler\NodeCompiler\BlockNodeCompiler::compileAnonymousBlock @@ -124,6 +128,7 @@ public function testDoubleBlock() /** * @group mixins + * * @covers :: * @covers \Phug\Compiler::compileDocument * @covers \Phug\Compiler\NodeCompiler\BlockNodeCompiler::compileAnonymousBlock @@ -177,6 +182,7 @@ public function testDynamicMixins() /** * @group mixins + * * @covers :: * @covers \Phug\Compiler\NodeCompiler\MixinNodeCompiler:: */ @@ -274,6 +280,7 @@ public function testMissingMixin() /** * @group mixins + * * @covers :: * @covers \Phug\Compiler\NodeCompiler\BlockNodeCompiler:: * @covers \Phug\Compiler\NodeCompiler\BlockNodeCompiler::compileAnonymousBlock @@ -299,6 +306,7 @@ public function testMixinAttributes() /** * @group mixins + * * @covers :: * @covers \Phug\Compiler\NodeCompiler\BlockNodeCompiler:: * @covers \Phug\Compiler\NodeCompiler\BlockNodeCompiler::compileAnonymousBlock diff --git a/tests/Phug/Compiler/NodeCompiler/MixinNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/MixinNodeCompilerTest.php index be53dbc5..7245afd5 100644 --- a/tests/Phug/Compiler/NodeCompiler/MixinNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/MixinNodeCompilerTest.php @@ -14,6 +14,7 @@ class MixinNodeCompilerTest extends AbstractCompilerTest { /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() @@ -29,6 +30,7 @@ public function testException() /** * @group mixins + * * @covers :: */ public function testRecursion() @@ -60,6 +62,7 @@ public function testRecursion() /** * @group mixins + * * @covers :: */ public function testRecursionWithBlock() @@ -94,7 +97,9 @@ public function testRecursionWithBlock() /** * @group mixins + * * @covers \Phug\Compiler\NodeCompiler\BlockNodeCompiler ::compileAnonymousBlock + * * @expectedException \Phug\CompilerException */ public function testAnonymousBlocksOutsideMixin() diff --git a/tests/Phug/Compiler/NodeCompiler/TextNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/TextNodeCompilerTest.php index 18856bd6..4dbe79ee 100644 --- a/tests/Phug/Compiler/NodeCompiler/TextNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/TextNodeCompilerTest.php @@ -62,6 +62,7 @@ public function testText() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/VariableNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/VariableNodeCompilerTest.php index b1659663..514be7f1 100644 --- a/tests/Phug/Compiler/NodeCompiler/VariableNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/VariableNodeCompilerTest.php @@ -26,6 +26,7 @@ public function testCompile() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testExpressionException() @@ -39,6 +40,7 @@ public function testExpressionException() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/WhenNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/WhenNodeCompilerTest.php index b27dd572..18c1488c 100644 --- a/tests/Phug/Compiler/NodeCompiler/WhenNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/WhenNodeCompilerTest.php @@ -14,6 +14,7 @@ class WhenNodeCompilerTest extends AbstractCompilerTest { /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/Compiler/NodeCompiler/WhileNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/WhileNodeCompilerTest.php index d841989b..873f3052 100644 --- a/tests/Phug/Compiler/NodeCompiler/WhileNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/WhileNodeCompilerTest.php @@ -64,6 +64,7 @@ public function testCompile() /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() @@ -80,6 +81,7 @@ public function testException() /** * @covers :: * @covers \Phug\Compiler\NodeCompiler\DoNodeCompiler:: + * * @expectedException \Phug\CompilerException */ public function testDoAndWhileSeededException() diff --git a/tests/Phug/Compiler/NodeCompiler/YieldNodeCompilerTest.php b/tests/Phug/Compiler/NodeCompiler/YieldNodeCompilerTest.php index 7d95587c..8c08e83a 100644 --- a/tests/Phug/Compiler/NodeCompiler/YieldNodeCompilerTest.php +++ b/tests/Phug/Compiler/NodeCompiler/YieldNodeCompilerTest.php @@ -14,6 +14,7 @@ class YieldNodeCompilerTest extends AbstractCompilerTest { /** * @covers :: + * * @expectedException \Phug\CompilerException */ public function testException() diff --git a/tests/Phug/CompilerModuleTest.php b/tests/Phug/CompilerModuleTest.php index 1d2e2de2..8a1d395f 100644 --- a/tests/Phug/CompilerModuleTest.php +++ b/tests/Phug/CompilerModuleTest.php @@ -21,6 +21,7 @@ class CompilerModuleTest extends TestCase { /** * @group modules + * * @covers :: * @covers \Phug\Compiler\Event\CompileEvent:: */ @@ -53,6 +54,7 @@ public function testCompileEvent() /** * @group modules + * * @covers :: * @covers \Phug\Compiler\Event\OutputEvent:: */ @@ -174,6 +176,7 @@ public function testPrependOutput() /** * @group modules + * * @covers :: * @covers \Phug\Compiler\Event\NodeEvent:: */ @@ -245,6 +248,7 @@ public function testUntransformableNode() /** * @group modules + * * @covers :: * @covers \Phug\Compiler\Event\ElementEvent:: */ diff --git a/tests/Phug/CompilerTest.php b/tests/Phug/CompilerTest.php index a96f18ad..24d7a56e 100644 --- a/tests/Phug/CompilerTest.php +++ b/tests/Phug/CompilerTest.php @@ -162,6 +162,7 @@ public function testGetCompiledChildren() /** * @covers ::__construct + * * @expectedException \InvalidArgumentException */ public function testParserClassException() @@ -180,6 +181,7 @@ public function testParserClassException() /** * @covers ::__construct + * * @expectedException \InvalidArgumentException */ public function testFormatterClassException() @@ -198,6 +200,7 @@ public function testFormatterClassException() /** * @covers ::__construct + * * @expectedException \InvalidArgumentException */ public function testLocatorClassException() @@ -213,6 +216,7 @@ public function testLocatorClassException() /** * @covers ::setNodeCompiler + * * @expectedException \InvalidArgumentException */ public function testSetNodeCompilerException() @@ -228,6 +232,7 @@ public function testSetNodeCompilerException() /** * @covers ::compileNode + * * @expectedException \Phug\CompilerException */ public function testCompileNodeException() @@ -246,6 +251,7 @@ public function testCompileNodeException() * @covers ::locate * @covers ::resolve * @covers \Phug\Compiler\NodeCompiler\ImportNodeCompiler::compileNode + * * @expectedException \Phug\CompilerException */ public function testAbsolutePathWithoutPaths() @@ -283,7 +289,9 @@ public function testResolve() /** * @covers ::resolve + * * @expectedException \Phug\CompilerException + * * @expectedExceptionMessage Source file not-existent not found */ public function testResolveNotFoundException() @@ -294,6 +302,7 @@ public function testResolveNotFoundException() /** * @group hooks + * * @covers ::compileNode * @covers ::compile * @covers ::__construct @@ -409,6 +418,7 @@ function ($name) { /** * @covers ::throwException + * * @expectedException \Phug\CompilerException */ public function testThrowException() @@ -419,7 +429,9 @@ public function testThrowException() /** * @covers ::throwException + * * @expectedException \Phug\CompilerException + * * @expectedExceptionMessage foobar.pug */ public function testThrowExceptionFileName() @@ -441,6 +453,7 @@ public function testAssertSuccess() /** * @covers ::assert + * * @expectedException \Phug\CompilerException */ public function testAssertFailure() @@ -451,7 +464,9 @@ public function testAssertFailure() /** * @covers ::initializeFormatter + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage Passed formatter class stdClass is not a valid Phug\Formatter */ public function testInitializeFormatterException() @@ -594,7 +609,9 @@ public function testUpperLocator() /** * @covers ::compileNode + * * @expectedException \Phug\CompilerException + * * @expectedExceptionMessage Failed to compile: No compiler found able to compile Phug\Test\Utils\UnknownNode */ public function testUnknownNodeThrowException() diff --git a/tests/Phug/Element/AssignmentElementTest.php b/tests/Phug/Element/AssignmentElementTest.php index e618b078..742469e9 100644 --- a/tests/Phug/Element/AssignmentElementTest.php +++ b/tests/Phug/Element/AssignmentElementTest.php @@ -162,7 +162,9 @@ public function testAttributeElement() * @covers \Phug\Formatter\Format\XmlFormat::formatAttributeAssignments * @covers \Phug\Formatter\Format\XmlFormat::yieldAssignmentAttributes * @covers \Phug\Formatter\Format\XmlFormat::formatMarkupAttributes + * * @expectedException \Phug\FormatterException + * * @expectedExceptionMessage Unable to handle class assignment */ public function testFormatAssignmentElementException() diff --git a/tests/Phug/Element/KeywordElementTest.php b/tests/Phug/Element/KeywordElementTest.php index 69e51ea5..2bedba9b 100644 --- a/tests/Phug/Element/KeywordElementTest.php +++ b/tests/Phug/Element/KeywordElementTest.php @@ -112,7 +112,9 @@ public function testPhpReturn() /** * @covers \Phug\Formatter\AbstractFormat::formatKeywordElement + * * @expectedException \Phug\FormatterException + * * @expectedExceptionMessage The keyword foo returned an invalid value type */ public function testBadReturn() diff --git a/tests/Phug/Event/ListenerQueueTest.php b/tests/Phug/Event/ListenerQueueTest.php index 50f99cfc..695d6f41 100644 --- a/tests/Phug/Event/ListenerQueueTest.php +++ b/tests/Phug/Event/ListenerQueueTest.php @@ -57,7 +57,9 @@ public function testInsert() /** * @covers ::insertMultiple + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage insertMultiple only accept array or Traversable as first argument */ public function testInsertMultipleBadType() @@ -70,7 +72,9 @@ public function testInsertMultipleBadType() /** * @covers ::insertMultiple + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage Callback inserted into ListenerQueue needs to be callable */ public function testInsertMultipleBadSubInsert() @@ -110,6 +114,7 @@ public function provideParameterValues() /** * @covers ::insert + * * @dataProvider provideParameterValues */ public function testInsertWithNonCallback($parameterValue) diff --git a/tests/Phug/Format/HtmlFormatTest.php b/tests/Phug/Format/HtmlFormatTest.php index f7e22815..a6e78f8b 100644 --- a/tests/Phug/Format/HtmlFormatTest.php +++ b/tests/Phug/Format/HtmlFormatTest.php @@ -209,7 +209,9 @@ public function testFormatVariable() /** * @covers \Phug\Formatter\AbstractFormat::throwException * @covers \Phug\Formatter\Format\XmlFormat::isSelfClosingTag + * * @expectedException \Phug\FormatterException + * * @expectedExceptionMessage input is a self closing element: but contains nested content. */ public function testChildrenInSelfClosingTag() @@ -237,7 +239,9 @@ public function testEmptyTextInSelfClosingTag() /** * @covers \Phug\Formatter\AbstractFormat::throwException * @covers \Phug\Formatter\Format\XmlFormat::isSelfClosingTag + * * @expectedException \Phug\FormatterException + * * @expectedExceptionMessage input is a self closing element: but contains nested content. */ public function testTextInSelfClosingTag() diff --git a/tests/Phug/Format/XmlFormatTest.php b/tests/Phug/Format/XmlFormatTest.php index a4a70cb1..d49ac02c 100644 --- a/tests/Phug/Format/XmlFormatTest.php +++ b/tests/Phug/Format/XmlFormatTest.php @@ -815,7 +815,7 @@ public function testAttributeAttributePrecedence() public function testAttributeAttributePrecedenceFailure() { self::expectExceptionObject(new InvalidArgumentException( - 'Option attribute_precedence must be "assignment" (default), "attribute", "left", "right" or a callable.', + 'Option attribute_precedence must be "assignment" (default), "attribute", "left", "right" or a callable.' )); $this->prepareTest(); diff --git a/tests/Phug/FormatterTest.php b/tests/Phug/FormatterTest.php index 0ca905f4..160c4a95 100644 --- a/tests/Phug/FormatterTest.php +++ b/tests/Phug/FormatterTest.php @@ -794,6 +794,7 @@ public function testFormatCode() /** * @group debug + * * @covers \Phug\Formatter\AbstractFormat::format * @covers \Phug\Formatter\AbstractFormat::formatElementChildren * @covers \Phug\Formatter::getSourceLine @@ -914,6 +915,7 @@ public function testFormatCodeWithDebug() /** * @group debug + * * @covers \Phug\Formatter::getSourceLine * @covers \Phug\Formatter::getDebugError */ diff --git a/tests/Phug/Invoker/InvokerTest.php b/tests/Phug/Invoker/InvokerTest.php index cb315597..ae889a30 100644 --- a/tests/Phug/Invoker/InvokerTest.php +++ b/tests/Phug/Invoker/InvokerTest.php @@ -23,6 +23,7 @@ class InvokerTest extends TestCase * @covers ::getCallbackType * * @expectedException RuntimeException + * * @expectedExceptionMessage Passed callback #1 should have at least 1 argument and this first argument must have a typehint. * * @throws ReflectionException @@ -40,6 +41,7 @@ function ($event) { * @covers ::addCallback * * @expectedException RuntimeException + * * @expectedExceptionMessage The #2 value is not callable. * * @throws ReflectionException diff --git a/tests/Phug/Lexer/Scanner/AttributeScannerTest.php b/tests/Phug/Lexer/Scanner/AttributeScannerTest.php index 33186456..c7752f57 100644 --- a/tests/Phug/Lexer/Scanner/AttributeScannerTest.php +++ b/tests/Phug/Lexer/Scanner/AttributeScannerTest.php @@ -197,6 +197,7 @@ public function testScanSpacing() * @covers \Phug\Lexer\Scanner\AttributeScanner::scanParenthesesContent * @covers \Phug\Lexer\Scanner\AttributeScanner::scanParentheses * @covers \Phug\Lexer\Scanner\AttributeScanner::scan + * * @expectedException \Phug\LexerException */ public function testFailsOnUnclosedBracket() diff --git a/tests/Phug/Lexer/Scanner/CaseScannerTest.php b/tests/Phug/Lexer/Scanner/CaseScannerTest.php index f48d0d27..a33e3c34 100644 --- a/tests/Phug/Lexer/Scanner/CaseScannerTest.php +++ b/tests/Phug/Lexer/Scanner/CaseScannerTest.php @@ -23,6 +23,7 @@ protected function getStatementName() * @covers \Phug\Lexer\Scanner\ControlStatementScanner::scan * @covers \Phug\Lexer\Scanner\Partial\NamespaceAndTernaryTrait::checkForTernary * @covers \Phug\Lexer\Scanner\Partial\NamespaceAndTernaryTrait::checkForNamespaceAndTernary + * * @dataProvider provideExpressions */ public function testExpandedExpressions($expr) diff --git a/tests/Phug/Lexer/Scanner/ClassScannerTest.php b/tests/Phug/Lexer/Scanner/ClassScannerTest.php index c0a04926..0f11531c 100644 --- a/tests/Phug/Lexer/Scanner/ClassScannerTest.php +++ b/tests/Phug/Lexer/Scanner/ClassScannerTest.php @@ -13,7 +13,6 @@ class ClassScannerTest extends AbstractLexerTest */ public function testSingleClass() { - /** @var ClassToken $tok */ list($tok) = $this->assertTokens('.some-class', [ ClassToken::class, @@ -28,7 +27,6 @@ public function testSingleClass() */ public function testMultipleClasses() { - /** * @var ClassToken * @var ClassToken $b @@ -50,7 +48,6 @@ public function testMultipleClasses() public function testCommonNamingPatterns() { - /** @var ClassToken $tok */ list($tok) = $this->assertTokens('.--some-class', [ ClassToken::class, diff --git a/tests/Phug/Lexer/Scanner/ConditionalScannerTest.php b/tests/Phug/Lexer/Scanner/ConditionalScannerTest.php index 70e51487..566ae10c 100644 --- a/tests/Phug/Lexer/Scanner/ConditionalScannerTest.php +++ b/tests/Phug/Lexer/Scanner/ConditionalScannerTest.php @@ -28,6 +28,7 @@ protected function getStatementName() * @covers \Phug\Lexer\Scanner\ControlStatementScanner::scan * @covers \Phug\Lexer\Scanner\Partial\NamespaceAndTernaryTrait::checkForTernary * @covers \Phug\Lexer\Scanner\Partial\NamespaceAndTernaryTrait::checkForNamespaceAndTernary + * * @dataProvider provideExpressions */ public function testExpandedExpressions($expr) @@ -119,7 +120,9 @@ public function testElseIfExpandedExpressions($expr, $stmt) /** * @covers Phug\Lexer\Scanner\ConditionalScanner::scan + * * @expectedException Phug\LexerException + * * @expectedExceptionMessage The `else`-conditional statement can't have a subject */ public function testElseWithSubject() diff --git a/tests/Phug/Lexer/Scanner/DoScannerTest.php b/tests/Phug/Lexer/Scanner/DoScannerTest.php index d7807c78..27382481 100644 --- a/tests/Phug/Lexer/Scanner/DoScannerTest.php +++ b/tests/Phug/Lexer/Scanner/DoScannerTest.php @@ -21,7 +21,6 @@ class DoScannerTest extends AbstractLexerTest */ public function testSingleLine() { - /* @var DoToken $tok */ $this->assertTokens("do\n", [DoToken::class, NewLineToken::class]); } @@ -36,7 +35,6 @@ public function testSingleLine() */ public function testExpanded() { - /* @var DoToken $tok */ $this->assertTokens('do: p something', [ DoToken::class, diff --git a/tests/Phug/Lexer/Scanner/DoctypeScannerTest.php b/tests/Phug/Lexer/Scanner/DoctypeScannerTest.php index ed40dbec..0bea6b2f 100644 --- a/tests/Phug/Lexer/Scanner/DoctypeScannerTest.php +++ b/tests/Phug/Lexer/Scanner/DoctypeScannerTest.php @@ -13,7 +13,6 @@ class DoctypeScannerTest extends AbstractLexerTest */ public function testCommonDoctypes() { - /** @var DoctypeToken $tok */ list($tok) = $this->assertTokens( 'doctype 5', diff --git a/tests/Phug/Lexer/Scanner/EachScannerTest.php b/tests/Phug/Lexer/Scanner/EachScannerTest.php index 02e63187..2ea68df1 100644 --- a/tests/Phug/Lexer/Scanner/EachScannerTest.php +++ b/tests/Phug/Lexer/Scanner/EachScannerTest.php @@ -43,11 +43,11 @@ public function provideInvalidSyntaxStyles() * @covers ::scan * @covers \Phug\Lexer\Scanner\Partial\NamespaceAndTernaryTrait::checkForTernary * @covers \Phug\Lexer\Scanner\Partial\NamespaceAndTernaryTrait::checkForNamespaceAndTernary + * * @dataProvider provideExpressions */ public function testWithItemOnly($expr) { - /** @var EachToken $tok */ list($tok) = $this->assertTokens("each \$item in $expr", [EachToken::class]); @@ -59,11 +59,11 @@ public function testWithItemOnly($expr) * @covers ::scan * @covers \Phug\Lexer\Scanner\Partial\NamespaceAndTernaryTrait::checkForTernary * @covers \Phug\Lexer\Scanner\Partial\NamespaceAndTernaryTrait::checkForNamespaceAndTernary + * * @dataProvider provideExpressions */ public function testWithItemAndKey($expr) { - /** @var EachToken $tok */ list($tok) = $this->assertTokens("each \$someItem, \$someKey in $expr", [EachToken::class]); @@ -74,11 +74,11 @@ public function testWithItemAndKey($expr) /** * @covers ::scan + * * @dataProvider provideExpressions */ public function testExpandedWithItemOnly($expr) { - /** @var EachToken $tok */ list($tok) = $this->assertTokens("each \$item in $expr: p Some Text", [ EachToken::class, @@ -93,11 +93,11 @@ public function testExpandedWithItemOnly($expr) /** * @covers ::scan + * * @dataProvider provideExpressions */ public function testExpandedWithItemAndKey($expr) { - /** @var EachToken $tok */ list($tok) = $this->assertTokens("each \$someItem, \$someKey in $expr: p Some Text", [ EachToken::class, @@ -113,7 +113,9 @@ public function testExpandedWithItemAndKey($expr) /** * @dataProvider provideInvalidSyntaxStyles + * * @covers ::scan + * * @expectedException \Phug\LexerException */ public function testThatItFailsWithInvalidSyntax($syntax) @@ -124,7 +126,9 @@ public function testThatItFailsWithInvalidSyntax($syntax) /** * @covers ::scan + * * @expectedException \Phug\LexerException + * * @expectedExceptionMessage `each`-statement has no subject to operate on */ public function testEachWithoutSubject() diff --git a/tests/Phug/Lexer/Scanner/ForScannerTest.php b/tests/Phug/Lexer/Scanner/ForScannerTest.php index 06b2ae2b..572e359b 100644 --- a/tests/Phug/Lexer/Scanner/ForScannerTest.php +++ b/tests/Phug/Lexer/Scanner/ForScannerTest.php @@ -23,6 +23,7 @@ protected function getStatementName() * @covers \Phug\Lexer\Scanner\ControlStatementScanner::scan * @covers \Phug\Lexer\Scanner\Partial\NamespaceAndTernaryTrait::checkForTernary * @covers \Phug\Lexer\Scanner\Partial\NamespaceAndTernaryTrait::checkForNamespaceAndTernary + * * @dataProvider provideExpressions */ public function testExpandedExpressions($expr) diff --git a/tests/Phug/Lexer/Scanner/IndentationScannerTest.php b/tests/Phug/Lexer/Scanner/IndentationScannerTest.php index b80dbca0..ba74b4be 100644 --- a/tests/Phug/Lexer/Scanner/IndentationScannerTest.php +++ b/tests/Phug/Lexer/Scanner/IndentationScannerTest.php @@ -166,6 +166,7 @@ public function testMixedIndentation() * @covers \Phug\Lexer\Scanner\IndentationScanner::formatIndentChar * @covers \Phug\Lexer\Scanner\IndentationScanner::getIndentChar * @covers \Phug\LexerException:: + * * @expectedException \Phug\LexerException */ public function testInconsistentIndent() @@ -186,6 +187,7 @@ public function testInconsistentIndent() /** * @covers \Phug\Lexer\Scanner\IndentationScanner::formatIndentChar * @covers \Phug\Lexer\Scanner\IndentationScanner::getIndentLevel + * * @expectedException \Phug\LexerException */ public function testNotAllowedMixedIndent() diff --git a/tests/Phug/Lexer/Scanner/WhenScannerTest.php b/tests/Phug/Lexer/Scanner/WhenScannerTest.php index 14d46575..d4366389 100644 --- a/tests/Phug/Lexer/Scanner/WhenScannerTest.php +++ b/tests/Phug/Lexer/Scanner/WhenScannerTest.php @@ -26,6 +26,7 @@ protected function getStatementName() * @covers \Phug\Lexer\Scanner\ControlStatementScanner::scan * @covers \Phug\Lexer\Scanner\Partial\NamespaceAndTernaryTrait::checkForTernary * @covers \Phug\Lexer\Scanner\Partial\NamespaceAndTernaryTrait::checkForNamespaceAndTernary + * * @dataProvider provideExpressions */ public function testExpandedExpressions($expr) @@ -35,7 +36,6 @@ public function testExpandedExpressions($expr) public function testDefault() { - /** @var WhenToken $tok */ list($tok) = $this->assertTokens('default: p Do something', [ WhenToken::class, diff --git a/tests/Phug/Lexer/Scanner/WhileScannerTest.php b/tests/Phug/Lexer/Scanner/WhileScannerTest.php index 57d21cce..09a03fae 100644 --- a/tests/Phug/Lexer/Scanner/WhileScannerTest.php +++ b/tests/Phug/Lexer/Scanner/WhileScannerTest.php @@ -23,6 +23,7 @@ protected function getStatementName() * @covers \Phug\Lexer\Scanner\ControlStatementScanner::scan * @covers \Phug\Lexer\Scanner\Partial\NamespaceAndTernaryTrait::checkForTernary * @covers \Phug\Lexer\Scanner\Partial\NamespaceAndTernaryTrait::checkForNamespaceAndTernary + * * @dataProvider provideExpressions */ public function testExpandedExpressions($expr) diff --git a/tests/Phug/Lexer/StateTest.php b/tests/Phug/Lexer/StateTest.php index 28e8711a..66fc9589 100644 --- a/tests/Phug/Lexer/StateTest.php +++ b/tests/Phug/Lexer/StateTest.php @@ -20,7 +20,9 @@ class StateTest extends TestCase { /** * @covers ::__construct + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage Configuration option `reader_class_name` * @expectedExceptionMessage needs to be a valid FQCN of a class * @expectedExceptionMessage that extends Phug\Reader @@ -71,7 +73,9 @@ public function testSetIndentStyle() /** * @covers \Phug\Lexer\Partial\IndentStyleTrait::setIndentStyle + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage indentStyle needs to be null or one of the INDENT_* constants of the lexer */ public function testSetIndentStyleException() @@ -120,7 +124,9 @@ public function testSetIndentWidth() /** * @covers \Phug\Lexer\Partial\IndentStyleTrait::setIndentWidth + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage indentWidth needs to be null or an integer above 0 */ public function testSetIndentWidthException() @@ -143,7 +149,9 @@ public function testCreateToken() /** * @covers ::createToken * @covers ::throwException + * * @expectedException \Phug\LexerException + * * @expectedExceptionMessage Failed to lex: bar * @expectedExceptionMessage Near: p Hello * @expectedExceptionMessage Line: 1 @@ -161,7 +169,9 @@ public function testCreateTokenException() /** * @covers ::__construct + * * @expectedException \Phug\ReaderException + * * @expectedExceptionMessage Path: path.pug */ public function testReaderExceptionWithPath() @@ -203,7 +213,9 @@ public function testScan() * @covers ::scan * @covers ::filterScanners * @covers ::throwException + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage The passed scanner with key `tag` * @expectedExceptionMessage doesn't seem to be either a valid * @expectedExceptionMessage Phug\Lexer\ScannerInterface @@ -222,7 +234,9 @@ public function testFilterScanersException() * @covers ::scan * @covers ::filterScanners * @covers ::throwException + * * @expectedException \Phug\LexerException + * * @expectedExceptionMessage Scanner Phug\Test\MockScanner * @expectedExceptionMessage generated a result that is not a * @expectedExceptionMessage Phug\Lexer\TokenInterface @@ -245,7 +259,9 @@ public function testScanException() /** * @covers ::loopScan * @covers ::throwException + * * @expectedException \Phug\LexerException + * * @expectedExceptionMessage Unexpected p Hello */ public function testLoopScanException() diff --git a/tests/Phug/LexerModuleTest.php b/tests/Phug/LexerModuleTest.php index 5493101f..7ebf5a79 100644 --- a/tests/Phug/LexerModuleTest.php +++ b/tests/Phug/LexerModuleTest.php @@ -244,7 +244,9 @@ public function testTokenGeneratorEvent() /** * @covers \Phug\Lexer\Event\TokenEvent::setTokenGenerator + * * @expectedException InvalidArgumentException + * * @expectedExceptionMessage setTokenGenerator(iterable $tokens) expect its argument to be iterable, integer received. */ public function testTokenGeneratorBadInput() diff --git a/tests/Phug/LexerTest.php b/tests/Phug/LexerTest.php index 317ac5e0..f26bb144 100644 --- a/tests/Phug/LexerTest.php +++ b/tests/Phug/LexerTest.php @@ -41,6 +41,7 @@ public function testGetScanners() /** * @covers \Phug\Lexer\Partial\StateTrait::getState + * * @expectedException \RuntimeException */ public function testGetStateException() @@ -148,6 +149,7 @@ public function testAddScanner() /** * @covers ::filterScanner + * * @expectedException \InvalidArgumentException */ public function testFilterScanner() @@ -165,6 +167,7 @@ public function testFilterScanner() /** * @covers ::lex + * * @expectedException \InvalidArgumentException */ public function testBadStateClassName() diff --git a/tests/Phug/OptimizerTest.php b/tests/Phug/OptimizerTest.php index 5f5b974a..1dfa4e01 100644 --- a/tests/Phug/OptimizerTest.php +++ b/tests/Phug/OptimizerTest.php @@ -88,7 +88,9 @@ public function testUpToDateCheck() /** * @covers \Phug\Phug::cacheDirectory + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage Expected $options to be an array, got: 'biz' */ public function testCacheDirectoryWithWrongOptions() diff --git a/tests/Phug/Parser/StateTest.php b/tests/Phug/Parser/StateTest.php index fc17dbfd..3de56162 100644 --- a/tests/Phug/Parser/StateTest.php +++ b/tests/Phug/Parser/StateTest.php @@ -142,7 +142,9 @@ public function testHandleTokenTwice() /** * @covers ::handleToken + * * @expectedException \Phug\ParserException + * * @expectedExceptionMessage Failed to parse: Unexpected token * @expectedExceptionMessage `Phug\Lexer\Token\TagToken`, * @expectedExceptionMessage no token handler registered @@ -387,7 +389,9 @@ public function testParentNodeIs() /** * @covers ::createNode + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage ErrorException is not a valid token class */ public function testCreateNodeException() @@ -447,7 +451,9 @@ public function testLeave() /** * @covers ::leave + * * @expectedException \Phug\ParserException + * * @expectedExceptionMessage Failed to outdent: No parent to outdent to. * @expectedExceptionMessage Seems the parser moved out too many levels. */ @@ -495,7 +501,9 @@ public function testStore() /** * @covers ::throwException + * * @expectedException \Phug\ParserException + * * @expectedExceptionMessage Failed to parse: Unexpected token * @expectedExceptionMessage `Phug\Lexer\Token\TagToken`, * @expectedExceptionMessage no token handler registered diff --git a/tests/Phug/Parser/TokenHandler/AssignmentTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/AssignmentTokenHandlerTest.php index 6fa2e1e7..890c8012 100644 --- a/tests/Phug/Parser/TokenHandler/AssignmentTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/AssignmentTokenHandlerTest.php @@ -73,7 +73,9 @@ public function testHandleTokenWithNothingNext() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass Assignment tokens to this token handler */ public function testHandleTokenTokenException() @@ -86,7 +88,9 @@ public function testHandleTokenTokenException() /** * @covers :: + * * @expectedException \Phug\ParserException + * * @expectedExceptionMessage Failed to parse: Assignments can only happen on elements and mixinCalls */ public function testHandleTokenElementTagsException() diff --git a/tests/Phug/Parser/TokenHandler/AttributeEndTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/AttributeEndTokenHandlerTest.php index 2d82d039..aa866a86 100644 --- a/tests/Phug/Parser/TokenHandler/AttributeEndTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/AttributeEndTokenHandlerTest.php @@ -30,7 +30,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass attribute end tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/AttributeStartTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/AttributeStartTokenHandlerTest.php index 7b4d1ef1..cc4479fb 100644 --- a/tests/Phug/Parser/TokenHandler/AttributeStartTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/AttributeStartTokenHandlerTest.php @@ -64,7 +64,9 @@ public function testHandleTokenFull() /** * @covers :: * @covers Phug\Parser\TokenHandler\AttributeStartTokenHandler:: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass attribute start tokens to this token handler */ public function testHandleTokenTokenException() @@ -78,7 +80,9 @@ public function testHandleTokenTokenException() /** * @covers :: * @covers \Phug\Parser\TokenHandler\AttributeStartTokenHandler:: + * * @expectedException \Phug\ParserException + * * @expectedExceptionMessage Failed to parse: Attributes can only be placed on * @expectedExceptionMessage element, assignment, import, variable, * @expectedExceptionMessage mixin and mixinCall @@ -101,7 +105,9 @@ public function testHandleTokenElementTagsException() /** * @covers :: * @covers \Phug\Parser\TokenHandler\AttributeStartTokenHandler:: + * * @expectedException \Phug\ParserException + * * @expectedExceptionMessage Attribute list not closed */ public function testHandleTokenListNotClosedException() diff --git a/tests/Phug/Parser/TokenHandler/AttributeTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/AttributeTokenHandlerTest.php index b54b44a9..247ad39b 100644 --- a/tests/Phug/Parser/TokenHandler/AttributeTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/AttributeTokenHandlerTest.php @@ -47,7 +47,9 @@ public function testNoCurrentNode() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass attribute tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/AutoCloseTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/AutoCloseTokenHandlerTest.php index f7924d51..9a8f3c87 100644 --- a/tests/Phug/Parser/TokenHandler/AutoCloseTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/AutoCloseTokenHandlerTest.php @@ -89,7 +89,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass auto-close tokens to this token handler */ public function testHandleTokenTokenException() @@ -102,7 +104,9 @@ public function testHandleTokenTokenException() /** * @covers :: + * * @expectedException \Phug\ParserException + * * @expectedExceptionMessage Auto-close operators can only be used on elements */ public function testHandleClassOnWrongNode() diff --git a/tests/Phug/Parser/TokenHandler/BlockTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/BlockTokenHandlerTest.php index 9a0b774f..74428564 100644 --- a/tests/Phug/Parser/TokenHandler/BlockTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/BlockTokenHandlerTest.php @@ -27,7 +27,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass block tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/CaseTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/CaseTokenHandlerTest.php index 22cbd963..091ff85e 100644 --- a/tests/Phug/Parser/TokenHandler/CaseTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/CaseTokenHandlerTest.php @@ -27,7 +27,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass case tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/ClassTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/ClassTokenHandlerTest.php index 76a58bc4..483a10ff 100644 --- a/tests/Phug/Parser/TokenHandler/ClassTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/ClassTokenHandlerTest.php @@ -50,7 +50,9 @@ public function testClassNamePassedToAttribute() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass class tokens to this token handler */ public function testHandleTokenTokenException() @@ -63,7 +65,9 @@ public function testHandleTokenTokenException() /** * @covers :: + * * @expectedException \Phug\ParserException + * * @expectedExceptionMessage Classes can only be used on elements and mixin calls */ public function testHandleClassOnWrongNode() diff --git a/tests/Phug/Parser/TokenHandler/CodeTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/CodeTokenHandlerTest.php index 47d54f1b..f73b2dc4 100644 --- a/tests/Phug/Parser/TokenHandler/CodeTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/CodeTokenHandlerTest.php @@ -98,7 +98,9 @@ public function testHandleCodeValue() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass code tokens to this token handler */ public function testHandleTokenTokenException() @@ -112,7 +114,9 @@ public function testHandleTokenTokenException() /** * @covers :: * @covers \Phug\Parser\State::throwException + * * @expectedException \Phug\ParserException + * * @expectedExceptionMessage Unexpected token `blockcode` expected `text`, `interpolated-code` or `code` */ public function testHandleTokenUnexpectedBlock() diff --git a/tests/Phug/Parser/TokenHandler/CommentTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/CommentTokenHandlerTest.php index c70db216..7c9dc3b3 100644 --- a/tests/Phug/Parser/TokenHandler/CommentTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/CommentTokenHandlerTest.php @@ -40,7 +40,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass comment tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/ConditionalTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/ConditionalTokenHandlerTest.php index d6453d83..6877074a 100644 --- a/tests/Phug/Parser/TokenHandler/ConditionalTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/ConditionalTokenHandlerTest.php @@ -28,7 +28,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass conditional tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/DoTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/DoTokenHandlerTest.php index b5756ff1..b14aa56f 100644 --- a/tests/Phug/Parser/TokenHandler/DoTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/DoTokenHandlerTest.php @@ -32,7 +32,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass do tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/DoctypeTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/DoctypeTokenHandlerTest.php index c46e451c..06d7a7ab 100644 --- a/tests/Phug/Parser/TokenHandler/DoctypeTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/DoctypeTokenHandlerTest.php @@ -27,7 +27,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass doctype tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/EachTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/EachTokenHandlerTest.php index 0d633132..00820946 100644 --- a/tests/Phug/Parser/TokenHandler/EachTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/EachTokenHandlerTest.php @@ -29,7 +29,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass each tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/ExpansionTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/ExpansionTokenHandlerTest.php index ed976cee..942e3124 100644 --- a/tests/Phug/Parser/TokenHandler/ExpansionTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/ExpansionTokenHandlerTest.php @@ -74,7 +74,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass expansion tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/ExpressionTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/ExpressionTokenHandlerTest.php index 49c040a5..d8932186 100644 --- a/tests/Phug/Parser/TokenHandler/ExpressionTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/ExpressionTokenHandlerTest.php @@ -33,7 +33,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass expression tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/FilterTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/FilterTokenHandlerTest.php index 78c7122d..053e800b 100644 --- a/tests/Phug/Parser/TokenHandler/FilterTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/FilterTokenHandlerTest.php @@ -89,7 +89,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass filter tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/ForTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/ForTokenHandlerTest.php index 70d35541..37b26cfe 100644 --- a/tests/Phug/Parser/TokenHandler/ForTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/ForTokenHandlerTest.php @@ -29,7 +29,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass for tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/IdTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/IdTokenHandlerTest.php index 01ef6681..7031a9c7 100644 --- a/tests/Phug/Parser/TokenHandler/IdTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/IdTokenHandlerTest.php @@ -37,7 +37,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass id tokens to this token handler */ public function testHandleTokenTokenException() @@ -50,7 +52,9 @@ public function testHandleTokenTokenException() /** * @covers :: + * * @expectedException \Phug\ParserException + * * @expectedExceptionMessage IDs can only be used on elements and mixin calls */ public function testHandleTokenElementException() diff --git a/tests/Phug/Parser/TokenHandler/ImportTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/ImportTokenHandlerTest.php index c407c275..35d013eb 100644 --- a/tests/Phug/Parser/TokenHandler/ImportTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/ImportTokenHandlerTest.php @@ -38,7 +38,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass import tokens to this token handler */ public function testHandleTokenTokenException() @@ -52,7 +54,9 @@ public function testHandleTokenTokenException() /** * @covers :: * @covers ::isEmptyDocument + * * @expectedException \Phug\ParserException + * * @expectedExceptionMessage extends should be the very first statement in a document */ public function testDivTagBeforeExtends() @@ -63,7 +67,9 @@ public function testDivTagBeforeExtends() /** * @covers :: * @covers ::isEmptyDocument + * * @expectedException \Phug\ParserException + * * @expectedExceptionMessage extends should be the very first statement in a document */ public function testVisibleCommentBeforeExtends() @@ -74,7 +80,9 @@ public function testVisibleCommentBeforeExtends() /** * @covers :: * @covers ::isEmptyDocument + * * @expectedException \Phug\ParserException + * * @expectedExceptionMessage extends should be the very first statement in a document */ public function testMultipleThingsBeforeExtends() diff --git a/tests/Phug/Parser/TokenHandler/IndentTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/IndentTokenHandlerTest.php index 4aae531d..dfeaed36 100644 --- a/tests/Phug/Parser/TokenHandler/IndentTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/IndentTokenHandlerTest.php @@ -29,7 +29,9 @@ public function testHandleSingleLine() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass indent tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/InterpolationEndTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/InterpolationEndTokenHandlerTest.php index 95b2853f..3851bf75 100644 --- a/tests/Phug/Parser/TokenHandler/InterpolationEndTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/InterpolationEndTokenHandlerTest.php @@ -16,7 +16,9 @@ class InterpolationEndTokenHandlerTest extends TestCase { /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass interpolation end tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/InterpolationStartTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/InterpolationStartTokenHandlerTest.php index 2aad0bc4..ad334cf7 100644 --- a/tests/Phug/Parser/TokenHandler/InterpolationStartTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/InterpolationStartTokenHandlerTest.php @@ -127,7 +127,9 @@ public function testInterpolationInNestedBlock() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass interpolation start tokens to this token handler */ public function testHandleTokenTokenException() @@ -207,7 +209,9 @@ public function testInterpolationsWithOneTagPerLine() /** * @covers :: + * * @expectedException \Phug\ParserException + * * @expectedExceptionMessage Interpolation not properly closed */ public function testBadEndingException() diff --git a/tests/Phug/Parser/TokenHandler/KeywordTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/KeywordTokenHandlerTest.php index ec02d6b7..5855d0e3 100644 --- a/tests/Phug/Parser/TokenHandler/KeywordTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/KeywordTokenHandlerTest.php @@ -43,7 +43,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass keyword tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/MixinCallTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/MixinCallTokenHandlerTest.php index a8ca9004..1011d8b5 100644 --- a/tests/Phug/Parser/TokenHandler/MixinCallTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/MixinCallTokenHandlerTest.php @@ -39,7 +39,9 @@ public function testHandleSingleLine() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass mixin call tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/MixinTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/MixinTokenHandlerTest.php index 92b28314..44cfc85f 100644 --- a/tests/Phug/Parser/TokenHandler/MixinTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/MixinTokenHandlerTest.php @@ -29,7 +29,9 @@ public function testHandleSingleLine() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass mixin tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/NewLineTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/NewLineTokenHandlerTest.php index 9cfcfccc..546bcc75 100644 --- a/tests/Phug/Parser/TokenHandler/NewLineTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/NewLineTokenHandlerTest.php @@ -31,7 +31,9 @@ public function testHandleSingleLine() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass newline tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/OutdentTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/OutdentTokenHandlerTest.php index 1498938a..9079c422 100644 --- a/tests/Phug/Parser/TokenHandler/OutdentTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/OutdentTokenHandlerTest.php @@ -31,7 +31,9 @@ public function testHandleSingleLine() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass outdent tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/TagInterpolationEndTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/TagInterpolationEndTokenHandlerTest.php index 2c3832c9..74ce312b 100644 --- a/tests/Phug/Parser/TokenHandler/TagInterpolationEndTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/TagInterpolationEndTokenHandlerTest.php @@ -16,7 +16,9 @@ class TagInterpolationEndTokenHandlerTest extends TestCase { /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass tag interpolation end tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/TagInterpolationStartTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/TagInterpolationStartTokenHandlerTest.php index 18829d2a..9e6322e7 100644 --- a/tests/Phug/Parser/TokenHandler/TagInterpolationStartTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/TagInterpolationStartTokenHandlerTest.php @@ -127,7 +127,9 @@ public function testExpansionWithInterpolations() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass tag interpolation start tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/TagTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/TagTokenHandlerTest.php index a929a94a..e3586e32 100644 --- a/tests/Phug/Parser/TokenHandler/TagTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/TagTokenHandlerTest.php @@ -50,7 +50,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass tag tokens to this token handler */ public function testHandleTokenTokenException() @@ -63,7 +65,9 @@ public function testHandleTokenTokenException() /** * @covers :: + * * @expectedException \Phug\ParserException + * * @expectedExceptionMessage Failed to parse: Tags can only be used on elements */ public function testHandleTokenElementTagsException() @@ -83,7 +87,9 @@ public function testHandleTokenElementTagsException() /** * @covers :: + * * @expectedException \Phug\ParserException + * * @expectedExceptionMessage Failed to parse: The element already has a tag name */ public function testHandleTokenTagNameException() diff --git a/tests/Phug/Parser/TokenHandler/TextTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/TextTokenHandlerTest.php index 9ebdad36..087bb4e3 100644 --- a/tests/Phug/Parser/TokenHandler/TextTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/TextTokenHandlerTest.php @@ -60,7 +60,9 @@ public function testHandleMarkup() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass text tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/VariableTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/VariableTokenHandlerTest.php index a460bc86..cccfaf76 100644 --- a/tests/Phug/Parser/TokenHandler/VariableTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/VariableTokenHandlerTest.php @@ -28,7 +28,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass variable tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/WhenTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/WhenTokenHandlerTest.php index 00363090..9b72832e 100644 --- a/tests/Phug/Parser/TokenHandler/WhenTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/WhenTokenHandlerTest.php @@ -50,7 +50,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass when tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/WhileTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/WhileTokenHandlerTest.php index 550bc6e5..851e2096 100644 --- a/tests/Phug/Parser/TokenHandler/WhileTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/WhileTokenHandlerTest.php @@ -45,7 +45,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass while tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/Parser/TokenHandler/YieldTokenHandlerTest.php b/tests/Phug/Parser/TokenHandler/YieldTokenHandlerTest.php index 0513f0ee..0bca7050 100644 --- a/tests/Phug/Parser/TokenHandler/YieldTokenHandlerTest.php +++ b/tests/Phug/Parser/TokenHandler/YieldTokenHandlerTest.php @@ -27,7 +27,9 @@ public function testHandleToken() /** * @covers :: + * * @expectedException \RuntimeException + * * @expectedExceptionMessage You can only pass yield tokens to this token handler */ public function testHandleTokenTokenException() diff --git a/tests/Phug/ParserModuleTest.php b/tests/Phug/ParserModuleTest.php index abad96a4..4ecd9af9 100644 --- a/tests/Phug/ParserModuleTest.php +++ b/tests/Phug/ParserModuleTest.php @@ -109,6 +109,7 @@ public function testStateEnterLeaveStoreEvents() /** * @group events + * * @covers \Phug\Parser::__construct * @covers \Phug\Parser\Event\ParseEvent:: * @covers \Phug\Parser\Event\NodeEvent:: diff --git a/tests/Phug/ParserTest.php b/tests/Phug/ParserTest.php index 56099a00..c62a8264 100644 --- a/tests/Phug/ParserTest.php +++ b/tests/Phug/ParserTest.php @@ -22,7 +22,9 @@ public function testParseAssignment() /** * @covers :: + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage Passed lexer class ErrorException is not a valid Phug\Lexer */ public function testWrongLexerClassNameOption() @@ -34,7 +36,9 @@ public function testWrongLexerClassNameOption() /** * @covers :: + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage Passed token handler needs to implement Phug\Parser\TokenHandlerInterface */ public function testWrongTokenHandler() @@ -45,7 +49,9 @@ public function testWrongTokenHandler() /** * @covers :: * @covers ::dumpNode + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage parser_state_class_name needs to be a valid Phug\Parser\State sub class */ public function testWrongStateClassNameOption() diff --git a/tests/Phug/PhugTest.php b/tests/Phug/PhugTest.php index 35c87792..4bc803d0 100644 --- a/tests/Phug/PhugTest.php +++ b/tests/Phug/PhugTest.php @@ -258,7 +258,9 @@ public function testKeywords() /** * @covers ::setFilter + * * @expectedException \Phug\PhugException + * * @expectedExceptionMessage Invalid foo filter given: */ public function testWrongFilter() @@ -297,7 +299,9 @@ public function testGetExtensionsOptions() /** * @covers ::addExtension + * * @expectedException \Phug\PhugException + * * @expectedExceptionMessage Invalid not-an-extension extension given: */ public function testWrongExtension() diff --git a/tests/Phug/ProfilerModuleTest.php b/tests/Phug/ProfilerModuleTest.php index b13bca14..04eac097 100644 --- a/tests/Phug/ProfilerModuleTest.php +++ b/tests/Phug/ProfilerModuleTest.php @@ -19,6 +19,7 @@ class ProfilerModuleTest extends TestCase { /** * @group profiler + * * @covers ::record * @covers ::renderProfile * @covers ::cleanupProfilerNodes @@ -88,6 +89,7 @@ public function testRenderProfiler() /** * @group profiler + * * @covers ::record * @covers ::renderProfile * @covers ::recordDisplayEvent @@ -129,6 +131,7 @@ public function testLogProfiler() /** * @group profiler + * * @covers ::renderProfile * @covers \Phug\Renderer\Partial\Debug\DebuggerTrait::initDebugOptions */ @@ -151,6 +154,7 @@ public function testDebugDefaultOptions() /** * @group profiler + * * @covers ::renderProfile * @covers \Phug\Renderer\Partial\Debug\DebuggerTrait::initDebugOptions */ @@ -178,6 +182,7 @@ public function testMemoryLimitOptions() /** * @group profiler + * * @covers ::record * @covers ::renderProfile * @covers ::recordDisplayEvent @@ -216,6 +221,7 @@ public function testExecutionMaxTime() /** * @group profiler + * * @covers ::record * @covers ::renderProfile * @covers ::recordDisplayEvent @@ -265,6 +271,7 @@ public function testMemoryLimit() /** * @group profiler + * * @covers \Phug\Renderer\Profiler\TokenDump:: */ public function testTokenDump() @@ -294,6 +301,7 @@ public function testTokenDump() /** * @group profiler + * * @covers ::record * @covers ::renderProfile * @covers ::cleanupProfilerNodes @@ -347,6 +355,7 @@ public function testDisplayProfiler() /** * @group profiler + * * @covers ::reset * @covers ::initialize * @covers ::getFunctionDump @@ -396,6 +405,7 @@ public function testCustomDump() /** * @group profiler + * * @covers ::reset * @covers ::initialize * @covers ::getFunctionDump @@ -451,6 +461,7 @@ public function testEventVarDump() /** * @group profiler + * * @covers ::initialize * @covers ::getFunctionDump */ diff --git a/tests/Phug/ReaderTest.php b/tests/Phug/ReaderTest.php index a375fe8c..c1d0f0c9 100644 --- a/tests/Phug/ReaderTest.php +++ b/tests/Phug/ReaderTest.php @@ -198,6 +198,7 @@ public function testPeek() /** * @covers ::peek + * * @expectedException \InvalidArgumentException */ public function testPeekThrowsExceptionOnInvalidArguments() @@ -236,6 +237,7 @@ public function testMatch() * @covers ::getPregErrorText * @covers ::throwException * @covers \Phug\ReaderException + * * @expectedException \Phug\ReaderException */ public function testMatchFailsOnPregError() @@ -246,7 +248,9 @@ public function testMatchFailsOnPregError() /** * @covers ::throwException * @covers \Phug\ReaderException + * * @expectedException \Phug\ReaderException + * * @expectedExceptionMessage Path: path.pug */ public function testPathInErrors() @@ -275,6 +279,7 @@ public function testGetMatch() * @covers ::getMatch * @covers ::throwException * @covers \Phug\ReaderException + * * @expectedException \Phug\ReaderException */ public function testGetMatchCantOperateOnMissingMatchCall() @@ -297,6 +302,7 @@ public function testGetMatchData() * @covers ::getMatchData * @covers ::throwException * @covers \Phug\ReaderException + * * @expectedException \Phug\ReaderException */ public function testGetMatchDataCantOperateOnMissingMatchCall() @@ -336,6 +342,7 @@ public function testConsume() * @covers ::consume * @covers ::throwException * @covers \Phug\ReaderException + * * @expectedException \Phug\ReaderException */ public function testConsumeThrowsExceptionOnInvalidConsumeLength() @@ -361,6 +368,7 @@ public function testReadWhile() /** * @covers ::readWhile + * * @expectedException \InvalidArgumentException */ public function testReadWhileExpectsValidCallback() @@ -659,6 +667,7 @@ public function testReadString() * @covers ::readString * @covers ::throwException * @covers \Phug\ReaderException + * * @expectedException \Phug\ReaderException * * @dataProvider provideNotCorrectlyClosedStrings @@ -692,6 +701,7 @@ public function testReadExpression() * @covers ::readExpression * @covers ::throwException * @covers \Phug\ReaderException + * * @expectedException \Phug\ReaderException * * @dataProvider provideNotCorrectlyClosedBrackets @@ -726,7 +736,6 @@ public function testGetPregErrorText() public function testReadmeFirstLexingExample() { - //Some C-style example code $code = 'someVar = {a, "this is a string (really, it \"is\")", func(b, c), d}'; diff --git a/tests/Phug/RendererTest.php b/tests/Phug/RendererTest.php index a18051f5..9c0333d7 100644 --- a/tests/Phug/RendererTest.php +++ b/tests/Phug/RendererTest.php @@ -822,6 +822,7 @@ public function testHandleHtmlError() /** * @group error + * * @covers ::handleError * @covers \Phug\Renderer\Partial\AdapterTrait::getSandboxCall * @covers \Phug\Renderer\Partial\AdapterTrait::handleHtmlEvent @@ -1099,6 +1100,7 @@ public function testTwigOutput() /** * @expectedException Exception + * * @expectedExceptionMessage p= $undefined() */ public function testExtendsUndefinedCall() @@ -1120,6 +1122,7 @@ public function testExtendsUndefinedCall() /** * @expectedException Exception + * * @expectedExceptionMessage div= $undefined() */ public function testUndefinedCallInBlock() diff --git a/tests/Phug/Util/AssociativeStorageTest.php b/tests/Phug/Util/AssociativeStorageTest.php index a3ca61d4..c672804d 100644 --- a/tests/Phug/Util/AssociativeStorageTest.php +++ b/tests/Phug/Util/AssociativeStorageTest.php @@ -21,7 +21,9 @@ class AssociativeStorageTest extends TestCase /** * @covers :: * @covers ::attachStrictMode + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage Duplicate entity for the name foo */ public function testStrictMode() @@ -39,7 +41,9 @@ public function testStrictMode() /** * @covers :: * @covers ::attachStrictMode + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage Unknown mode: 99 */ public function testWrongMode() diff --git a/tests/Phug/Util/MacroableTraitTest.php b/tests/Phug/Util/MacroableTraitTest.php index c795f5b4..1bd9b0dc 100644 --- a/tests/Phug/Util/MacroableTraitTest.php +++ b/tests/Phug/Util/MacroableTraitTest.php @@ -130,7 +130,9 @@ public function testMacrosOption() /** * @covers \Phug\Util\Partial\MacroableTrait::__call + * * @expectedException \BadMethodCallException + * * @expectedExceptionMessage Method fooBar does not exist. */ public function testMacroCallBadMethod() @@ -141,7 +143,9 @@ public function testMacroCallBadMethod() /** * @covers \Phug\Util\Partial\MacroableTrait::__callStatic + * * @expectedException \BadMethodCallException + * * @expectedExceptionMessage Method fooBar does not exist. */ public function testMacroCallStaticBadMethod() diff --git a/tests/Phug/Util/ModuleContainerTest.php b/tests/Phug/Util/ModuleContainerTest.php index f15437af..2a4c80c9 100644 --- a/tests/Phug/Util/ModuleContainerTest.php +++ b/tests/Phug/Util/ModuleContainerTest.php @@ -100,7 +100,9 @@ public function testHasGetSetRemoveModule() /** * @covers ::getModuleBaseClassName * @covers ::addModule + * * @expectedException InvalidArgumentException + * * @expectedExceptionMessage Passed module class name stdClass needs to be a class extending Phug\Util\ModuleInterface and/or Phug\Util\ModuleInterface */ public function testInvalidModuleClassName() @@ -115,7 +117,9 @@ public function testInvalidModuleClassName() /** * @covers ::getModuleBaseClassName * @covers ::addModule + * * @expectedException InvalidArgumentException + * * @expectedExceptionMessage Module Phug\Test\Util\FirstTestModule is already registered. */ public function testDoubleRegistration() @@ -131,7 +135,9 @@ public function testDoubleRegistration() /** * @covers ::getModuleBaseClassName * @covers ::addModule + * * @expectedException InvalidArgumentException + * * @expectedExceptionMessage This occurrence of Phug\Test\Util\FirstTestModule is already registered. */ public function testInstanceDoubleRegistration() @@ -148,7 +154,9 @@ public function testInstanceDoubleRegistration() /** * @covers ::getModuleBaseClassName * @covers ::addModule + * * @expectedException InvalidArgumentException + * * @expectedExceptionMessage This occurrence of Phug\Test\Util\FirstTestModule is already registered in another module container. */ public function testInstanceDivergentRegistrations() @@ -164,7 +172,9 @@ public function testInstanceDivergentRegistrations() /** * @covers ::getModuleBaseClassName * @covers ::removeModule + * * @expectedException InvalidArgumentException + * * @expectedExceptionMessage The container doesn't contain a Phug\Test\Util\FirstTestModule module */ public function testRemovalOfNonExistentModule() @@ -180,7 +190,9 @@ public function testRemovalOfNonExistentModule() /** * @covers ::getModuleBaseClassName * @covers ::removeModule + * * @expectedException InvalidArgumentException + * * @expectedExceptionMessage This occurrence of Phug\Test\Util\FirstTestModule is not registered. */ public function testRemovalOfNonExistentModuleInstance() @@ -196,7 +208,9 @@ public function testRemovalOfNonExistentModuleInstance() /** * @covers ::addModule + * * @expectedException \RuntimeException + * * @expectedExceptionMessage Current module container uses the ModuleContainerTrait, but doesn't implement Phug\Util\ModuleContainerInterface, please implement it. */ public function testNonInterfacedContainer() diff --git a/tests/Phug/Util/UnorderedArgumentsTest.php b/tests/Phug/Util/UnorderedArgumentsTest.php index 02c68a30..953edc22 100644 --- a/tests/Phug/Util/UnorderedArgumentsTest.php +++ b/tests/Phug/Util/UnorderedArgumentsTest.php @@ -47,7 +47,9 @@ public function testRequired() /** * @covers ::required + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage Arguments miss one of the boolean type */ public function testRequiredException() @@ -72,7 +74,9 @@ public function testNoMoreArguments() /** * @covers ::noMoreArguments * @covers ::noMoreDefinedArguments + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage You pass 2 unexpected arguments */ public function testNoMoreArgumentsException() @@ -87,7 +91,9 @@ public function testNoMoreArgumentsException() /** * @covers ::noMoreArguments * @covers ::noMoreDefinedArguments + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage You pass 2 unexpected arguments */ public function testNoMoreUndefinedArgumentsException() @@ -103,7 +109,9 @@ public function testNoMoreUndefinedArgumentsException() /** * @covers ::noMoreArguments * @covers ::noMoreDefinedArguments + * * @expectedException \InvalidArgumentException + * * @expectedExceptionMessage You pass 1 unexpected not null arguments */ public function testNoMoreDefinedArgumentsException() diff --git a/tests/Phug/Utils/AssertRender.php b/tests/Phug/Utils/AssertRender.php index 77a68d9e..791ef5a7 100644 --- a/tests/Phug/Utils/AssertRender.php +++ b/tests/Phug/Utils/AssertRender.php @@ -18,7 +18,7 @@ protected function prepareTest() } $this->compiler = new Compiler([ - 'paths' => [__DIR__.'/../templates'], + 'paths' => [__DIR__.'/../../templates'], 'patterns' => [ 'expression_in_text' => '%s', 'expression_in_bool' => '%s', @@ -32,10 +32,10 @@ protected function implodeLines($str) $attributes = []; $input = $matches[0]; while (mb_strlen($input) && preg_match( - '/^\s+([a-z0-9:_-]+)="((?:\\\\[\\S\\s]|[^"\\\\])*)"/', - $input, - $match - )) { + '/^\s+([a-z0-9:_-]+)="((?:\\\\[\\S\\s]|[^"\\\\])*)"/', + $input, + $match + )) { if ($match[1] === 'class') { $classes = explode(' ', $match[2]); sort($classes);