diff --git a/composer.json b/composer.json index ee31ef8..a53e33b 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "aura/html": "~2.4" }, "require-dev": { - "phpunit/phpunit": "~4.4", + "phpunit/phpunit": "~4.8", "mockery/mockery": "0.9.3", "brain/monkey": "~1.1" }, diff --git a/composer.lock b/composer.lock index 610d323..c8b8b87 100644 --- a/composer.lock +++ b/composer.lock @@ -5,6 +5,7 @@ "This file is @generated automatically" ], "hash": "fed67da8c796b0e376413e0b64ccdc84", + "content-hash": "f17ccae2ca0744b78a85c3aa95a6ec77", "packages": [ { "name": "aura/html", @@ -162,16 +163,16 @@ }, { "name": "pimple/pimple", - "version": "v3.0.0", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/silexphp/Pimple.git", - "reference": "876bf0899d01feacd2a2e83f04641e51350099ef" + "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/silexphp/Pimple/zipball/876bf0899d01feacd2a2e83f04641e51350099ef", - "reference": "876bf0899d01feacd2a2e83f04641e51350099ef", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/a30f7d6e57565a2e1a316e1baf2a483f788b258a", + "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a", "shasum": "" }, "require": { @@ -198,28 +199,28 @@ "email": "fabien@symfony.com" } ], - "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", + "description": "Pimple, a simple Dependency Injection Container", "homepage": "http://pimple.sensiolabs.org", "keywords": [ "container", "dependency injection" ], - "time": "2014-07-24 09:48:15" + "time": "2015-09-11 15:10:35" } ], "packages-dev": [ { "name": "antecedent/patchwork", - "version": "1.3.4", + "version": "1.3.5", "source": { "type": "git", "url": "https://github.com/antecedent/patchwork.git", - "reference": "1a6197903bdc1d0d8b4c5218a9a0b60ed8ddc385" + "reference": "908a233f8a374f02b02ff5e3d6ba687ca506d57d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antecedent/patchwork/zipball/1a6197903bdc1d0d8b4c5218a9a0b60ed8ddc385", - "reference": "1a6197903bdc1d0d8b4c5218a9a0b60ed8ddc385", + "url": "https://api.github.com/repos/antecedent/patchwork/zipball/908a233f8a374f02b02ff5e3d6ba687ca506d57d", + "reference": "908a233f8a374f02b02ff5e3d6ba687ca506d57d", "shasum": "" }, "require": { @@ -247,20 +248,20 @@ "runkit", "testing" ], - "time": "2015-03-19 04:34:34" + "time": "2015-10-09 18:20:06" }, { "name": "brain/monkey", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/Giuseppe-Mazzapica/BrainMonkey.git", - "reference": "20e14aeb926e583bbd0547cc59d2bb40ed0bb4ce" + "reference": "f4515ccaa5457a3c3e35ea6d4c3da46efb809336" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Giuseppe-Mazzapica/BrainMonkey/zipball/20e14aeb926e583bbd0547cc59d2bb40ed0bb4ce", - "reference": "20e14aeb926e583bbd0547cc59d2bb40ed0bb4ce", + "url": "https://api.github.com/repos/Giuseppe-Mazzapica/BrainMonkey/zipball/f4515ccaa5457a3c3e35ea6d4c3da46efb809336", + "reference": "f4515ccaa5457a3c3e35ea6d4c3da46efb809336", "shasum": "" }, "require": { @@ -306,7 +307,7 @@ "test", "testing" ], - "time": "2015-05-28 17:06:17" + "time": "2015-07-12 23:36:21" }, { "name": "doctrine/instantiator", @@ -479,16 +480,16 @@ }, { "name": "phpspec/prophecy", - "version": "v1.4.1", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373" + "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", - "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", "shasum": "" }, "require": { @@ -535,20 +536,20 @@ "spy", "stub" ], - "time": "2015-04-27 22:15:08" + "time": "2015-08-13 10:07:40" }, { "name": "phpunit/php-code-coverage", - "version": "2.1.7", + "version": "2.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "07e27765596d72c378a6103e80da5d84e802f1e4" + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/07e27765596d72c378a6103e80da5d84e802f1e4", - "reference": "07e27765596d72c378a6103e80da5d84e802f1e4", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", "shasum": "" }, "require": { @@ -556,7 +557,7 @@ "phpunit/php-file-iterator": "~1.3", "phpunit/php-text-template": "~1.2", "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "~1.0", + "sebastian/environment": "^1.3.2", "sebastian/version": "~1.0" }, "require-dev": { @@ -571,7 +572,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "2.2.x-dev" } }, "autoload": { @@ -597,20 +598,20 @@ "testing", "xunit" ], - "time": "2015-06-30 06:52:35" + "time": "2015-10-06 15:47:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb" + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a923bb15680d0089e2316f7a4af8f437046e96bb", - "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", "shasum": "" }, "require": { @@ -644,7 +645,7 @@ "filesystem", "iterator" ], - "time": "2015-04-02 05:19:05" + "time": "2015-06-21 13:08:43" }, { "name": "phpunit/php-text-template", @@ -689,16 +690,16 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.6", + "version": "1.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "83fe1bdc5d47658b727595c14da140da92b3d66d" + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/83fe1bdc5d47658b727595c14da140da92b3d66d", - "reference": "83fe1bdc5d47658b727595c14da140da92b3d66d", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", "shasum": "" }, "require": { @@ -726,20 +727,20 @@ "keywords": [ "timer" ], - "time": "2015-06-13 07:35:30" + "time": "2015-06-21 08:01:12" }, { "name": "phpunit/php-token-stream", - "version": "1.4.3", + "version": "1.4.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9" + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/7a9b0969488c3c54fd62b4d504b3ec758fd005d9", - "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", "shasum": "" }, "require": { @@ -775,20 +776,20 @@ "keywords": [ "tokenizer" ], - "time": "2015-06-19 03:43:16" + "time": "2015-09-15 10:49:45" }, { "name": "phpunit/phpunit", - "version": "4.7.6", + "version": "4.8.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0ebabb4cda7d066be8391dfdbaf57fe70ac9a99b" + "reference": "625f8c345606ed0f3a141dfb88f4116f0e22978e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0ebabb4cda7d066be8391dfdbaf57fe70ac9a99b", - "reference": "0ebabb4cda7d066be8391dfdbaf57fe70ac9a99b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/625f8c345606ed0f3a141dfb88f4116f0e22978e", + "reference": "625f8c345606ed0f3a141dfb88f4116f0e22978e", "shasum": "" }, "require": { @@ -798,7 +799,7 @@ "ext-reflection": "*", "ext-spl": "*", "php": ">=5.3.3", - "phpspec/prophecy": "~1.3,>=1.3.1", + "phpspec/prophecy": "^1.3.1", "phpunit/php-code-coverage": "~2.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", @@ -806,7 +807,7 @@ "phpunit/phpunit-mock-objects": "~2.3", "sebastian/comparator": "~1.1", "sebastian/diff": "~1.2", - "sebastian/environment": "~1.2", + "sebastian/environment": "~1.3", "sebastian/exporter": "~1.2", "sebastian/global-state": "~1.0", "sebastian/version": "~1.0", @@ -821,7 +822,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.7.x-dev" + "dev-master": "4.8.x-dev" } }, "autoload": { @@ -847,26 +848,27 @@ "testing", "xunit" ], - "time": "2015-06-30 06:53:57" + "time": "2015-10-23 06:48:33" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.3.5", + "version": "2.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "1c330b1b6e1ea8fd15f2fbea46770576e366855c" + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/1c330b1b6e1ea8fd15f2fbea46770576e366855c", - "reference": "1c330b1b6e1ea8fd15f2fbea46770576e366855c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", "shasum": "" }, "require": { - "doctrine/instantiator": "~1.0,>=1.0.2", + "doctrine/instantiator": "^1.0.2", "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2" + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" }, "require-dev": { "phpunit/phpunit": "~4.4" @@ -902,20 +904,20 @@ "mock", "xunit" ], - "time": "2015-07-04 05:41:32" + "time": "2015-10-02 06:51:40" }, { "name": "sebastian/comparator", - "version": "1.1.1", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1dd8869519a225f7f2b9eb663e225298fade819e" + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dd8869519a225f7f2b9eb663e225298fade819e", - "reference": "1dd8869519a225f7f2b9eb663e225298fade819e", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", "shasum": "" }, "require": { @@ -929,7 +931,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -966,7 +968,7 @@ "compare", "equality" ], - "time": "2015-01-29 16:28:08" + "time": "2015-07-26 15:48:44" }, { "name": "sebastian/diff", @@ -1022,16 +1024,16 @@ }, { "name": "sebastian/environment", - "version": "1.2.2", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e" + "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5a8c7d31914337b69923db26c4221b81ff5a196e", - "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44", + "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44", "shasum": "" }, "require": { @@ -1068,20 +1070,20 @@ "environment", "hhvm" ], - "time": "2015-01-01 10:01:08" + "time": "2015-08-03 06:14:51" }, { "name": "sebastian/exporter", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "84839970d05254c73cde183a721c7af13aede943" + "reference": "7ae5513327cb536431847bcc0c10edba2701064e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943", - "reference": "84839970d05254c73cde183a721c7af13aede943", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", + "reference": "7ae5513327cb536431847bcc0c10edba2701064e", "shasum": "" }, "require": { @@ -1134,20 +1136,20 @@ "export", "exporter" ], - "time": "2015-01-27 07:23:06" + "time": "2015-06-21 07:55:53" }, { "name": "sebastian/global-state", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", "shasum": "" }, "require": { @@ -1185,20 +1187,20 @@ "keywords": [ "global state" ], - "time": "2014-10-06 09:23:50" + "time": "2015-10-12 03:26:01" }, { "name": "sebastian/recursion-context", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252" + "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", + "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", "shasum": "" }, "require": { @@ -1238,7 +1240,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-01-24 09:48:32" + "time": "2015-06-21 08:04:50" }, { "name": "sebastian/version", @@ -1277,24 +1279,21 @@ }, { "name": "symfony/yaml", - "version": "v2.7.1", + "version": "v2.7.6", "source": { "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160" + "url": "https://github.com/symfony/yaml.git", + "reference": "eca9019c88fbe250164affd107bc8057771f3f4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/9808e75c609a14f6db02f70fccf4ca4aab53c160", - "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160", + "url": "https://api.github.com/repos/symfony/yaml/zipball/eca9019c88fbe250164affd107bc8057771f3f4d", + "reference": "eca9019c88fbe250164affd107bc8057771f3f4d", "shasum": "" }, "require": { "php": ">=5.3.9" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, "type": "library", "extra": { "branch-alias": { @@ -1322,7 +1321,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-06-10 15:30:22" + "time": "2015-10-11 09:39:48" } ], "aliases": [], diff --git a/inc/functions.php b/inc/functions.php index de0defb..e95d150 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -46,15 +46,16 @@ function engine(array $options = [], array $providers = []) if (! function_exists('Foil\render')) { /** - * @param string $path Full path or just name (requires folders option) for the template - * @param array $data Template context - * @param array $options Options for the engine + * @param string $path Full path or just name (requires folders option) for the template + * @param array $data Template context + * @param array $options Options for the engine * @param array $providers * @return string */ function render($path, array $data = [], array $options = [], array $providers = []) { $foil = Foil::boot($options, $providers); + return $foil->engine()->render($path, $data); } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 1e994ac..8ce9e5c 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,5 @@ status() === self::STATUS_IDLE) { + $status = $this->status(); + if ($status === self::STATUS_IDLE) { $this->statusTransitions(); + } elseif ($status & self::STATUS_IDLE) { + $this->status = self::STATUS_IN_LAYOUT; } $template = $this->stack()->factory($path, $this, $class); $this->events->fire('f.template.render', $template, $data); $output = trim($template->render($data)); - $this->events->fire('f.template.renderered', $template, $output); + $this->events->fire('f.template.renderered', $template, $output, $this->status); return $output; } @@ -326,7 +329,8 @@ private function statusTransitions() $this->events->on('f.template.renderered', function () { $this->stack()->pop(); if ($this->stack()->count() === 0) { - $this->status = self::STATUS_RENDERED; + $this->status = self::STATUS_RENDERED | self::STATUS_IDLE; + $this->events->fire('f.renderered', $this); } }); } diff --git a/src/Extensions/AuraHtml.php b/src/Extensions/AuraHtml.php index 0017b22..44897e1 100644 --- a/src/Extensions/AuraHtml.php +++ b/src/Extensions/AuraHtml.php @@ -113,7 +113,7 @@ public function provideFunctions() } /** - * @param string $tag + * @param string $tag * @return mixed * @throws \Aura\Html\Exception\HelperNotFound * @link https://github.com/auraphp/Aura.Html/blob/2.x/README-HELPERS.md diff --git a/src/Extensions/Links.php b/src/Extensions/Links.php index 7e0d6e5..a33c968 100644 --- a/src/Extensions/Links.php +++ b/src/Extensions/Links.php @@ -145,37 +145,37 @@ public function asset($asset, $scheme = null) private function setupHost(array $args, $which = 'host') { $checks = [ - function(array $args, $which) { + function (array $args, $which) { return ! isset($args[$which]) || is_null($args[$which]); }, - function(array $args, $which) { + function (array $args, $which) { return empty($args[$which]); }, - function(array $args, $which) { + function (array $args, $which) { return is_string($args[$which]) && strtolower($args[$which]) !== 'auto'; }, - function(array $args, $which) { + function (array $args, $which) { return $args[$which] === true || is_string($args[$which]); - } + }, ]; $actions = [ - function($var, $which) { + function ($var, $which) { $this->$var = $which === 'host' ? false : null; }, - function($var) { + function ($var) { $this->$var = false; }, - function($var, $which, array $args) { + function ($var, $which, array $args) { $parse = parse_url($args[$which]); $host = isset($parse['host']) ? $parse['host'] : $parse['path']; $this->$var = $this->clean($host); }, - function($var) { + function ($var) { $this->$var = $this->clean(filter_input(INPUT_SERVER, 'SERVER_NAME')); }, ]; - foreach($checks as $i => $check) { + foreach ($checks as $i => $check) { if ($check($args, $which)) { $args = [ $which === 'assets_host' ? 'assetsHost' : 'host', diff --git a/src/Extensions/Sections.php b/src/Extensions/Sections.php index b8695eb..f55798a 100644 --- a/src/Extensions/Sections.php +++ b/src/Extensions/Sections.php @@ -74,6 +74,12 @@ public function __construct(Factory $factory, Events $events) */ public function setup(array $args = []) { + $this->events->on('f.renderered', function () { + $this->stack = new SplStack(); + $this->names = new SplStack(); + $this->factory->flush(); + }); + return; } diff --git a/src/Section/Factory.php b/src/Section/Factory.php index 80e1008..ce59545 100644 --- a/src/Section/Factory.php +++ b/src/Section/Factory.php @@ -58,8 +58,8 @@ public function __construct(ArrayAccess $sections, $defaultMode = null, $contrac /** * Factory a section instance (if it was not already factored) and return it. * - * @param string $name Section name - * @param int|bool $mode Section mode, one of the mode const + * @param string $name Section name + * @param int|bool $mode Section mode, one of the mode const * @param string $className Full qualified section class name * @return \Foil\Contracts\SectionInterface * @throws InvalidArgumentException @@ -100,4 +100,9 @@ public function getClass($class) return $class; } + + public function flush() + { + $this->sections = new \ArrayObject(); + } } diff --git a/src/Template/Alias.php b/src/Template/Alias.php index 2dee43a..f09cc2d 100644 --- a/src/Template/Alias.php +++ b/src/Template/Alias.php @@ -19,7 +19,6 @@ */ final class Alias { - const REGEX = '#^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$#'; /** @@ -49,8 +48,8 @@ public function __toString() */ private function validate($alias) { - if ( ! is_string($alias) || ! preg_match(self::REGEX, $alias)) { + if (! is_string($alias) || ! preg_match(self::REGEX, $alias)) { throw new InvalidArgumentException('Alias must be a valid variable name.'); } } -} \ No newline at end of file +} diff --git a/src/Template/Factory.php b/src/Template/Factory.php index 11fc5d1..afff282 100644 --- a/src/Template/Factory.php +++ b/src/Template/Factory.php @@ -85,7 +85,7 @@ public function __construct( /** * Factory and/or returns template objects. * - * @param string $path Full path to template file + * @param string $path Full path to template file * @param \Foil\Engine $engine * @param string $className A custom template class name * @return \Foil\Contracts\TemplateInterface diff --git a/tests/_files/bar/second.php b/tests/_files/bar/second.php index 88dc436..19b5931 100644 --- a/tests/_files/bar/second.php +++ b/tests/_files/bar/second.php @@ -1,16 +1,16 @@ layout('main', ['foo' => 'Bar!']) ?> section('one') ?> -World foo ?> + World foo ?> stop() ?> section('two') ?> -I Win + I Win replace() ?> -Buffalo Bill + Buffalo Bill section('three') ?> -MAN + MAN stop(); diff --git a/tests/_files/foo/blocks.php b/tests/_files/foo/blocks.php index d822e67..31b51aa 100644 --- a/tests/_files/foo/blocks.php +++ b/tests/_files/foo/blocks.php @@ -1,11 +1,11 @@ block('spaceless') ?> - block('wrap', '
', '
') ?> - block('spaceless') ?> - - endblock('spaceless') ?> - endblock('wrap') ?> +block('wrap', '
', '
') ?> +block('spaceless') ?> + +endblock('spaceless') ?> +endblock('wrap') ?> endblock('spaceless') ?> diff --git a/tests/_files/foo/main.php b/tests/_files/foo/main.php index a3c7316..ffd2924 100644 --- a/tests/_files/foo/main.php +++ b/tests/_files/foo/main.php @@ -1,14 +1,14 @@ section('one') ?> -Hello foo.' ' ?> + Hello foo.' ' ?> stop() ?> -Alone + Alone section('two') ?> -NO + NO stop() ?> section('three') ?> -YES + YES stop(); diff --git a/tests/_files/stubs.php b/tests/_files/stubs.php index 78f0919..0c4b5c3 100644 --- a/tests/_files/stubs.php +++ b/tests/_files/stubs.php @@ -4,6 +4,7 @@ class Value { + public $value; public function __construct($value) @@ -14,22 +15,25 @@ public function __construct($value) class ToArray extends Value { + public function toArray() { - return ['toarray' => (array) $this->value]; + return ['toarray' => (array)$this->value]; } } class AsArray extends Value { + public function asArray() { - return ['asarray' => (array) $this->value]; + return ['asarray' => (array)$this->value]; } } class Json implements JsonSerializable { + public function jsonSerialize() { return 'I am JSON'; @@ -38,10 +42,12 @@ public function jsonSerialize() class Target extends Value { + } class Transformer { + public function transform($object) { return is_object($object) ? ['transformed' => get_object_vars($object)] : false; diff --git a/tests/_files/templates/layout.php b/tests/_files/templates/layout.php index 7150a08..0d29bc4 100644 --- a/tests/_files/templates/layout.php +++ b/tests/_files/templates/layout.php @@ -1,90 +1,91 @@ - - - <?= $this->v('title', 'Default Title') ?> - - - - + + + <?= $this->v('title', 'Default Title') ?> + + + + - ww('menu', '
', '
  • %s
  • ') ?> +ww('menu', '
    ', '
  • %s
  • ') ?> - wwif('menu', false, '
    %s
    ', '
  • %s
  • ') ?> +wwif('menu', false, '
    %s
    ', '
  • %s
  • ') ?> -
    +
    -

    Deep var test: v('a.pretty.deep.var') ?>

    +

    Deep var test: v('a.pretty.deep.var') ?>

    -

    Default test: v('i_do_not_exist', 'I am a default.') ?>

    +

    Default test: v('i_do_not_exist', 'I am a default.') ?>

    -

    __get test: test_me ?>

    +

    __get test: test_me ?>

    -

    Raw test: raw('html_content') ?>

    +

    Raw test: raw('html_content') ?>

    -

    Autoescape test: html_content ?>

    +

    Autoescape test: html_content ?>

    -

    Filter test: f('uppercase|reverse', 'lowercase') ?>

    +

    Filter test: f('uppercase|reverse', 'lowercase') ?>

    -

    Advanced test: v('a.var.0|uppercase|reverse') ?>

    +

    Advanced test: v('a.var.0|uppercase|reverse') ?>

    -
    +
    -
    - returnSomething() ?> -
    +
    + returnSomething() ?> +
    -
    - insert('partials/partial', ['a_partial_var' => '"I am a partial var!"']) ?> -
    +
    + insert('partials/partial', ['a_partial_var' => '"I am a partial var!"']) ?> +
    -
    - raw('i_do_not_exist', $this->insert('partials/partial-2', ['a_partial_var' => '"I am a partial var too."'])) ?> -
    +
    + raw('i_do_not_exist', + $this->insert('partials/partial-2', ['a_partial_var' => '"I am a partial var too."'])) ?> +
    -
    - supply('a-section') ?> -
    +
    + supply('a-section') ?> +
    -
    - supply('a-non-existent-section', 'I am here.') ?> -
    +
    + supply('a-non-existent-section', 'I am here.') ?> +
    -
    +
    - section('first') ?> + section('first') ?> -

    MAIN LAYOUT, first section

    +

    MAIN LAYOUT, first section

    -
    +
    - section('first-child') ?> + section('first-child') ?> -

    MAIN LAYOUT, first child section

    +

    MAIN LAYOUT, first child section

    - stop() // first-child ?> + stop() // first-child ?> -
    +
    -

    MAIN LAYOUT, first section after child

    +

    MAIN LAYOUT, first section after child

    - stop() // first ?> + stop() // first ?> -
    +
    -
    +
    - section('second') ?> + section('second') ?> -

    MAIN LAYOUT, second section

    +

    MAIN LAYOUT, second section

    - stop() // second ?> + stop() // second ?> -
    +
    -
    - buffer() ?> -
    +
    + buffer() ?> +
    - + diff --git a/tests/boot.php b/tests/boot.php index 1edf178..8aaa6c1 100644 --- a/tests/boot.php +++ b/tests/boot.php @@ -10,7 +10,7 @@ $vendor = dirname(dirname(__FILE__)).'/vendor/'; -if (! realpath($vendor)) { +if ( ! realpath($vendor)) { die('Please install via Composer before running tests.'); } diff --git a/tests/src/Functional/AdvRenderTest.php b/tests/src/Functional/AdvRenderTest.php index b8de476..bb17e5b 100644 --- a/tests/src/Functional/AdvRenderTest.php +++ b/tests/src/Functional/AdvRenderTest.php @@ -20,6 +20,7 @@ */ class AdvRenderTest extends TestCaseFunctional { + private $templates_path; public function setUp() @@ -102,7 +103,7 @@ private function provideRegexContext() $context_failed = new RegexContext('/[0-9]+/', ['i_do_not_exist' => 'NOT SHOULD BE HERE']); $this->engine->useContext($context); $this->engine->useContext($context_failed); - $this->engine->useContext('/\.php$/', ['title' => 'Foil is Awesome!', ], true); + $this->engine->useContext('/\.php$/', ['title' => 'Foil is Awesome!',], true); } /** diff --git a/tests/src/Functional/BlocksTest.php b/tests/src/Functional/BlocksTest.php index 6c801e7..1dcab7f 100644 --- a/tests/src/Functional/BlocksTest.php +++ b/tests/src/Functional/BlocksTest.php @@ -18,6 +18,7 @@ */ class BlocksTest extends TestCaseFunctional { + /** * @coversNothing */ diff --git a/tests/src/Functional/EngineTest.php b/tests/src/Functional/EngineTest.php index 859feb1..1ff9296 100644 --- a/tests/src/Functional/EngineTest.php +++ b/tests/src/Functional/EngineTest.php @@ -21,6 +21,7 @@ */ class EngineTest extends TestCaseFunctional { + public function setUp() { parent::setUp(); diff --git a/tests/src/Functional/SimpleRenderTest.php b/tests/src/Functional/SimpleRenderTest.php index ecb1777..e71b986 100644 --- a/tests/src/Functional/SimpleRenderTest.php +++ b/tests/src/Functional/SimpleRenderTest.php @@ -19,6 +19,7 @@ */ class SimpleRenderTest extends TestCaseFunctional { + /** * @coversNothing */ @@ -29,6 +30,20 @@ public function testSimpleRender() assertSame('Hello Alone NO YES', $render); } + /** + * @coversNothing + */ + public function testSimpleRenderMoreTimes() + { + $this->initFoil(); + $render1 = preg_replace('/[\s]+/', ' ', $this->engine->render('main')); + $render2 = preg_replace('/[\s]+/', ' ', $this->engine->render('main')); + $render3 = preg_replace('/[\s]+/', ' ', $this->engine->render('main')); + assertSame('Hello Alone NO YES', $render1); + assertSame($render1, $render2); + assertSame($render2, $render3); + } + /** * @coversNothing */ @@ -65,8 +80,10 @@ function ($layout, Template $template) use (&$buffer) { $buffer = $template->buffer(); } ); - $render = preg_replace('/[\s]+/', ' ', $this->engine->render('second', ['foo' => 'Foo!'])); - assertSame('Hello Bar! World Foo! Alone I Win YES MAN', $render); + $render1 = preg_replace('/[\s]+/', ' ', $this->engine->render('second', ['foo' => 'Foo!'])); + $render2 = preg_replace('/[\s]+/', ' ', $this->engine->render('second', ['foo' => 'Foo!'])); + assertSame('Hello Bar! World Foo! Alone I Win YES MAN', $render1); + assertSame($render1, $render2); assertSame('Buffalo Bill', trim($buffer)); } diff --git a/tests/src/TestCase.php b/tests/src/TestCase.php index 4fd229b..2eb1233 100644 --- a/tests/src/TestCase.php +++ b/tests/src/TestCase.php @@ -22,6 +22,7 @@ */ class TestCase extends PHPUnit_Framework_TestCase { + protected function setUp() { parent::setUp(); @@ -56,14 +57,14 @@ protected function bindClosure(Closure $closure, $object, array $args = []) */ protected function accessPrivateProperty($property, $object) { - if (! is_string($property) || ! is_object($object)) { + if ( ! is_string($property) || ! is_object($object)) { throw new InvalidArgumentException( __METHOD__.' needs a valid property name and a valid object.' ); } return $this->bindClosure(function ($property) { - if (! isset($this->$property)) { + if ( ! isset($this->$property)) { throw new LogicException( "{$property} is not a set on the object." ); @@ -81,7 +82,7 @@ protected function accessPrivateProperty($property, $object) */ protected function setPrivateProperty($property, $value, $object) { - if (! is_string($property) || ! is_object($object)) { + if ( ! is_string($property) || ! is_object($object)) { throw new InvalidArgumentException( __METHOD__.' needs a valid property name and a valid object.' ); diff --git a/tests/src/TestCaseFunctional.php b/tests/src/TestCaseFunctional.php index 53e3281..1aaaeca 100644 --- a/tests/src/TestCaseFunctional.php +++ b/tests/src/TestCaseFunctional.php @@ -18,6 +18,7 @@ */ class TestCaseFunctional extends TestCase { + /** * @var \Foil\Engine */ diff --git a/tests/src/Unit/Blocks/BlockTest.php b/tests/src/Unit/Blocks/BlockTest.php index 5efd9f2..1be7555 100644 --- a/tests/src/Unit/Blocks/BlockTest.php +++ b/tests/src/Unit/Blocks/BlockTest.php @@ -20,6 +20,7 @@ */ class BlockTest extends TestCase { + public function testOpen() { $block = new Block('strtoupper'); diff --git a/tests/src/Unit/Blocks/BlocksTest.php b/tests/src/Unit/Blocks/BlocksTest.php index 880596b..eb9b02f 100644 --- a/tests/src/Unit/Blocks/BlocksTest.php +++ b/tests/src/Unit/Blocks/BlocksTest.php @@ -20,6 +20,7 @@ */ class BlocksTest extends TestCase { + /** * @expectedException \InvalidArgumentException */ diff --git a/tests/src/Unit/Blocks/FactoryTest.php b/tests/src/Unit/Blocks/FactoryTest.php index a59a5a8..d7f17d3 100644 --- a/tests/src/Unit/Blocks/FactoryTest.php +++ b/tests/src/Unit/Blocks/FactoryTest.php @@ -21,6 +21,7 @@ */ class FactoryTest extends TestCase { + public function testFactory() { $factory = new Factory(); diff --git a/tests/src/Unit/Context/CollectionTest.php b/tests/src/Unit/Context/CollectionTest.php index 03f38ca..4e3e198 100644 --- a/tests/src/Unit/Context/CollectionTest.php +++ b/tests/src/Unit/Context/CollectionTest.php @@ -20,6 +20,7 @@ */ class CollectionTest extends TestCase { + /** * @return \Foil\Context\Collection */ diff --git a/tests/src/Unit/Context/GlobalContextTest.php b/tests/src/Unit/Context/GlobalContextTest.php index dda4dc8..757f1d2 100644 --- a/tests/src/Unit/Context/GlobalContextTest.php +++ b/tests/src/Unit/Context/GlobalContextTest.php @@ -19,6 +19,7 @@ */ class GlobalContextTest extends TestCase { + public function testAccept() { $c = new GlobalContext(['foo' => 'bar']); diff --git a/tests/src/Unit/Context/RegexContextTest.php b/tests/src/Unit/Context/RegexContextTest.php index e2d7f55..0ee2779 100644 --- a/tests/src/Unit/Context/RegexContextTest.php +++ b/tests/src/Unit/Context/RegexContextTest.php @@ -20,6 +20,7 @@ */ class RegexContextTest extends TestCase { + /** * @expectedException \InvalidArgumentException */ diff --git a/tests/src/Unit/Context/SearchContextTest.php b/tests/src/Unit/Context/SearchContextTest.php index bd5d043..4c6f32b 100644 --- a/tests/src/Unit/Context/SearchContextTest.php +++ b/tests/src/Unit/Context/SearchContextTest.php @@ -19,6 +19,7 @@ */ class SearchContextTest extends TestCase { + /** * @expectedException \InvalidArgumentException */ diff --git a/tests/src/Unit/EngineTest.php b/tests/src/Unit/EngineTest.php index 8cfddd4..529439c 100644 --- a/tests/src/Unit/EngineTest.php +++ b/tests/src/Unit/EngineTest.php @@ -23,6 +23,7 @@ */ class EngineTest extends TestCase { + /** * @param \Foil\Kernel\Events $events * @param \Foil\Template\Finder $finder @@ -35,7 +36,7 @@ private function getEngine(Events $events = null, Finder $finder = null, $render $stack = Mockery::mock('Foil\Template\Stack'); /** @var \Foil\Template\Finder|\Mockery\MockInterface $finder */ - $finder = $finder ?: Mockery::mock('Foil\Template\Finder'); + $finder = $finder ? : Mockery::mock('Foil\Template\Finder'); if (is_null($events)) { /** @var \Foil\Kernel\Events|\Mockery\MockInterface $events */ $events = Mockery::mock('Foil\Kernel\Events'); @@ -71,7 +72,7 @@ private function getEngine(Events $events = null, Finder $finder = null, $render $events ->shouldReceive('fire') ->once() - ->with('f.template.renderered', $template, $render) + ->with('f.template.renderered', $template, $render, Mockery::type('int')) ->andReturnNull(); } diff --git a/tests/src/Unit/Extension/AuraHtmlTest.php b/tests/src/Unit/Extension/AuraHtmlTest.php index 06ac9b6..2be8ff8 100644 --- a/tests/src/Unit/Extension/AuraHtmlTest.php +++ b/tests/src/Unit/Extension/AuraHtmlTest.php @@ -21,6 +21,7 @@ */ class AuraHtmlTest extends TestCase { + private function sut($register_tag_functions = false) { return new AuraHtml((new HelperLocatorFactory())->newInstance(), $register_tag_functions); diff --git a/tests/src/Unit/Extension/BlocksTest.php b/tests/src/Unit/Extension/BlocksTest.php index a4d2220..3a06348 100644 --- a/tests/src/Unit/Extension/BlocksTest.php +++ b/tests/src/Unit/Extension/BlocksTest.php @@ -20,6 +20,7 @@ */ class BlocksTest extends TestCase { + public function testProvideFunctions() { /** @var \Foil\Blocks\Blocks $blocks */ diff --git a/tests/src/Unit/Extension/FiltersTest.php b/tests/src/Unit/Extension/FiltersTest.php index ead16b8..b415f01 100644 --- a/tests/src/Unit/Extension/FiltersTest.php +++ b/tests/src/Unit/Extension/FiltersTest.php @@ -19,6 +19,7 @@ */ class FiltersTest extends TestCase { + /** * @expectedException \InvalidArgumentException */ @@ -35,6 +36,7 @@ public function testFirst() assertSame('foo', $filters->first(['a' => 'foo', 'foo' => 'bar'])); assertSame('F', $filters->first('Foo')); } + /** * @expectedException \InvalidArgumentException */ diff --git a/tests/src/Unit/Extension/HelpersTest.php b/tests/src/Unit/Extension/HelpersTest.php index b579510..12d6e81 100644 --- a/tests/src/Unit/Extension/HelpersTest.php +++ b/tests/src/Unit/Extension/HelpersTest.php @@ -22,10 +22,11 @@ */ class HelpersTest extends TestCase { + /** - * @param array $data - * @param bool|string $strict - * @param bool $autoescape + * @param array $data + * @param bool|string $strict + * @param bool $autoescape * @return \Foil\Extensions\Helpers */ private function getHelpers($data = [], $strict = false, $autoescape = true) @@ -241,7 +242,7 @@ public function testAsArray() { $helpers = $this->getHelpers([ 'string' => '

    foo

    ', - 'object' => (object) ['id' => 'foo'], + 'object' => (object)['id' => 'foo'], ]); assertSame([htmlentities('

    foo

    ')], $helpers->asArray('string')); assertSame(['id' => 'foo'], $helpers->asArray('object')); @@ -249,7 +250,7 @@ public function testAsArray() public function testAsArrayRaw() { - $helpers = $this->getHelpers(['object' => (object) ['id' => '

    foo

    ']]); + $helpers = $this->getHelpers(['object' => (object)['id' => '

    foo

    ']]); assertSame(['id' => '

    foo

    '], $helpers->asArrayRaw('object')); } diff --git a/tests/src/Unit/Extension/LinksTest.php b/tests/src/Unit/Extension/LinksTest.php index dfbe94e..7fb89e3 100644 --- a/tests/src/Unit/Extension/LinksTest.php +++ b/tests/src/Unit/Extension/LinksTest.php @@ -19,6 +19,7 @@ */ class LinksTest extends TestCase { + public function testProvideFunctions() { $links = new Links(); @@ -67,7 +68,8 @@ public function testLinkDomainDirs() 'assets_host' => 'static.example.com', ]); assertSame('http://example.com/url/to/pdf/foo.pdf', $links->link('foo.pdf', 'pdf')); - assertSame('https://example.com/url/to/pdf/foo.pdf', $links->link('foo.pdf', 'pdf', 'https')); + assertSame('https://example.com/url/to/pdf/foo.pdf', + $links->link('foo.pdf', 'pdf', 'https')); } public function testAssetNothing() diff --git a/tests/src/Unit/Extension/UriTest.php b/tests/src/Unit/Extension/UriTest.php index 9540de3..38015e9 100644 --- a/tests/src/Unit/Extension/UriTest.php +++ b/tests/src/Unit/Extension/UriTest.php @@ -19,6 +19,7 @@ */ class UriTest extends TestCase { + public function testHome() { $u = new Uri(); diff --git a/tests/src/Unit/Extension/WalkerTest.php b/tests/src/Unit/Extension/WalkerTest.php index 942166a..4fc15ff 100644 --- a/tests/src/Unit/Extension/WalkerTest.php +++ b/tests/src/Unit/Extension/WalkerTest.php @@ -22,8 +22,9 @@ */ class WalkerTest extends TestCase { + /** - * @param bool $autoescape + * @param bool $autoescape * @return \Foil\Extensions\Walker|\Mockery\MockInterface */ private function getWalker($autoescape = true) diff --git a/tests/src/Unit/Kernel/ArraizeTest.php b/tests/src/Unit/Kernel/ArraizeTest.php index 332aa63..92ccf9c 100644 --- a/tests/src/Unit/Kernel/ArraizeTest.php +++ b/tests/src/Unit/Kernel/ArraizeTest.php @@ -24,6 +24,7 @@ */ class ArraizeTest extends TestCase { + private function e($var) { return call_user_func(new HtmlEscaper(), $var); @@ -35,8 +36,8 @@ public function testScalars() assertSame([$this->e('foo bar')], \Foil\arraize('foo bar', true)); assertSame([1], \Foil\arraize(1)); assertSame([true], \Foil\arraize(true)); - assertSame([(string) 1], \Foil\arraize(1, true, [], true)); - assertSame([(string) true], \Foil\arraize(true, true, [], true)); + assertSame([(string)1], \Foil\arraize(1, true, [], true)); + assertSame([(string)true], \Foil\arraize(true, true, [], true)); assertSame([], \Foil\arraize(null)); assertSame([], \Foil\arraize(false)); assertSame([], \Foil\arraize('')); @@ -131,7 +132,7 @@ public function testMix() $storage1 = new \SplObjectStorage(); $storage1->attach(new \stdClass()); $storage2 = new \SplObjectStorage(); - $storage2->attach((object) ['foo' => 'bar']); + $storage2->attach((object)['foo' => 'bar']); $data = [ 'lev1' => new \ArrayIterator([ 'lev1.1' => 'lev1.1', @@ -140,7 +141,7 @@ public function testMix() ]), 'lev2' => [ 'lev2.2' => [ - 'lev2.2.1' => (object) ['a' => 'a', 'b' => 'b'], + 'lev2.2.1' => (object)['a' => 'a', 'b' => 'b'], 'lev2.2.2' => [1, true, null], ], ], diff --git a/tests/src/Unit/Kernel/CommandTest.php b/tests/src/Unit/Kernel/CommandTest.php index 126d9dd..606984f 100644 --- a/tests/src/Unit/Kernel/CommandTest.php +++ b/tests/src/Unit/Kernel/CommandTest.php @@ -21,6 +21,7 @@ */ class CommandTest extends TestCase { + /** * @return \Foil\Contracts\EscaperInterface $escaper */ @@ -80,7 +81,7 @@ public function testFunctionNoEcho() public function testFunctionObject() { $test1 = function () { - return (object) ['foo' => 'bar']; + return (object)['foo' => 'bar']; }; $test2 = function () { return 'foo'; diff --git a/tests/src/Unit/Kernel/EscaperTest.php b/tests/src/Unit/Kernel/EscaperTest.php index e84d4ed..d8ec74c 100644 --- a/tests/src/Unit/Kernel/EscaperTest.php +++ b/tests/src/Unit/Kernel/EscaperTest.php @@ -26,6 +26,7 @@ */ class EscaperTest extends TestCase { + /** * @param mixed $data * @param string $encoding @@ -154,7 +155,7 @@ public function testAttr() public function testObjectArr() { $escaper = new Escaper($this->auraEscaper(), 'utf-8'); - $data = (object) ['class' => ['foo', 'bar'], 'id' => 'foo']; + $data = (object)['class' => ['foo', 'bar'], 'id' => 'foo']; $expected = 'class="foo bar" id="foo"'; assertSame($expected, $escaper->escape($data, 'attr')); @@ -200,7 +201,7 @@ public function testDecodeArray() public function testDecodeObject() { - $obj = (object) ['a' => '

    a

    ', 'b' => '

    b

    ']; + $obj = (object)['a' => '

    a

    ', 'b' => '

    b

    ']; $objStr = Mockery::mock(); $objStr->shouldReceive('__toString')->andReturn($this->e('

    a

    ')); diff --git a/tests/src/Unit/Kernel/EventsTest.php b/tests/src/Unit/Kernel/EventsTest.php index cc18579..1b5f33d 100644 --- a/tests/src/Unit/Kernel/EventsTest.php +++ b/tests/src/Unit/Kernel/EventsTest.php @@ -19,6 +19,7 @@ */ class EventsTest extends TestCase { + public function testFire() { $e = new Events(); diff --git a/tests/src/Unit/Section/FactoryTest.php b/tests/src/Unit/Section/FactoryTest.php index 6e3bd92..97dd42e 100644 --- a/tests/src/Unit/Section/FactoryTest.php +++ b/tests/src/Unit/Section/FactoryTest.php @@ -22,6 +22,7 @@ */ class FactoryTest extends TestCase { + /** * @expectedException \InvalidArgumentException */ diff --git a/tests/src/Unit/Section/SectionTest.php b/tests/src/Unit/Section/SectionTest.php index 1f41319..ce02713 100644 --- a/tests/src/Unit/Section/SectionTest.php +++ b/tests/src/Unit/Section/SectionTest.php @@ -19,6 +19,7 @@ */ class SectionTest extends TestCase { + /** * @expectedException \LogicException */ diff --git a/tests/src/Unit/Template/AliasTest.php b/tests/src/Unit/Template/AliasTest.php index fc78ca6..09c2112 100644 --- a/tests/src/Unit/Template/AliasTest.php +++ b/tests/src/Unit/Template/AliasTest.php @@ -20,6 +20,7 @@ */ class AliasTest extends TestCase { + /** * @expectedException \InvalidArgumentException */ diff --git a/tests/src/Unit/Template/FactoryTest.php b/tests/src/Unit/Template/FactoryTest.php index 01d259d..82f522f 100644 --- a/tests/src/Unit/Template/FactoryTest.php +++ b/tests/src/Unit/Template/FactoryTest.php @@ -21,8 +21,9 @@ */ class FactoryTest extends TestCase { + /** - * @param string|bool $class + * @param string|bool $class * @return \Foil\Template\Factory */ private function getTemplateFactory($class = false) diff --git a/tests/src/Unit/Template/FinderTest.php b/tests/src/Unit/Template/FinderTest.php index 95b83d7..4f094c8 100644 --- a/tests/src/Unit/Template/FinderTest.php +++ b/tests/src/Unit/Template/FinderTest.php @@ -19,8 +19,9 @@ */ class FinderTest extends TestCase { + /** - * @param bool $named + * @param bool $named * @return array */ private function finderDirectories($named = false) @@ -31,7 +32,7 @@ private function finderDirectories($named = false) $base.DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, ['_files', 'bar']), ]; - return (! $named) ? $dirs : array_combine(['foo', 'bar'], $dirs); + return ( ! $named) ? $dirs : array_combine(['foo', 'bar'], $dirs); } /** diff --git a/tests/src/Unit/Template/StackTest.php b/tests/src/Unit/Template/StackTest.php index 2715473..fdadf88 100644 --- a/tests/src/Unit/Template/StackTest.php +++ b/tests/src/Unit/Template/StackTest.php @@ -20,6 +20,7 @@ */ class StackTest extends TestCase { + public function testFactory() { /** @var \Foil\Template\Factory|\Mockery\MockInterface $factory */ diff --git a/tests/src/Unit/Template/TemplateTest.php b/tests/src/Unit/Template/TemplateTest.php index d52420d..b9edd53 100644 --- a/tests/src/Unit/Template/TemplateTest.php +++ b/tests/src/Unit/Template/TemplateTest.php @@ -22,6 +22,7 @@ */ class TemplateTest extends TestCase { + public function testCall() { /** @var \Foil\Engine $engine */