Skip to content

Commit 69638ab

Browse files
committed
Chore: Changes
- Renamed phpunit.xml to phpunit.xml.dist; - Added coverage to phpunit.xml.dist; - Added `friendsofphp/php-cs-fixer` as dev-requirement; - Moved unit tests to unit folder; - Added .gitattributes file; - Finished unit tests; - Fixed small bug when trying to check entrypoint without extension and strict_types enabled;
1 parent 721912a commit 69638ab

File tree

14 files changed

+290
-122
lines changed

14 files changed

+290
-122
lines changed

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/tests export-ignore
2+
/phpunit.xml.dist export-ignore
3+
/.gitattributes export-ignore
4+
/.gitignore export-ignore
5+
6+
*.php diff=php

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
vendor
22
composer.lock
33
.phpunit.result.cache
4+
test-coverage-report
5+
phpunit.xml

composer.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
{
22
"name": "boo/webpack-encore-plugin",
33
"description": "This is a Micro plugin for webpack-encore support",
4-
"type": "library",
4+
"type": "micro-plugin",
55
"version": "0.1",
66
"license": "MIT",
77
"require": {
88
"micro/plugin-twig": "^0"
99
},
1010
"require-dev": {
11+
"friendsofphp/php-cs-fixer": "^3.13",
1112
"phpunit/phpunit": "^9.5"
1213
},
1314
"autoload": {
1415
"psr-4": {
15-
"Boo\\WebpackEncorePlugin\\": "src/",
16+
"Boo\\WebpackEncorePlugin\\": "src"
1617
}
1718
},
1819
"autoload-dev": {
1920
"psr-4": {
20-
"Boo\\WebpackEncorePlugin\\Tests\\": "tests/"
21+
"Boo\\WebpackEncorePlugin\\Tests\\Unit\\": "tests/unit"
2122
}
2223
},
2324
"authors": [
@@ -28,5 +29,11 @@
2829
],
2930
"config": {
3031
"sort-packages": true
32+
},
33+
"extra": {
34+
"thanks": {
35+
"name": "symfony/webpack-encore-bundle",
36+
"url": "https://github.com/symfony/webpack-encore-bundle"
37+
}
3138
}
3239
}

phpunit.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.

phpunit.xml.dist

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- https://phpunit.readthedocs.io/en/9.5/configuration.html#the-phpunit-element -->
3+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
5+
backupGlobals="false"
6+
bootstrap="vendor/autoload.php"
7+
colors="true"
8+
failOnRisky="true"
9+
failOnWarning="true"
10+
>
11+
<php>
12+
<ini name="error_reporting" value="-1" force="true"/>
13+
</php>
14+
<testsuites>
15+
<testsuite name="Unit tests">
16+
<directory>tests/</directory>
17+
</testsuite>
18+
</testsuites>
19+
<coverage>
20+
<include>
21+
<directory suffix=".php">src</directory>
22+
</include>
23+
<report>
24+
<html outputDirectory="test-coverage-report/" />
25+
</report>
26+
</coverage>
27+
</phpunit>

src/Twig/Extension/EntryFilesTwigExtension.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
use Twig\Extension\AbstractExtension;
1010
use Twig\TwigFunction;
1111

12+
/**
13+
* @codeCoverageIgnore
14+
*/
1215
class EntryFilesTwigExtension extends AbstractExtension
1316
{
1417
private TagRendererInterface $tagRenderer;

src/WebpackEncorePlugin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
/**
1818
* @method WebpackEncorePluginConfigurationInterface configuration()
19+
* @codeCoverageIgnore
1920
*/
2021
class WebpackEncorePlugin implements TwigExtensionPluginInterface, ConfigurableInterface
2122
{

src/WebpackEncorePluginConfiguration.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
use Micro\Framework\Kernel\Configuration\PluginConfiguration;
88

9+
/**
10+
* @codeCoverageIgnore
11+
*/
912
class WebpackEncorePluginConfiguration extends PluginConfiguration implements WebpackEncorePluginConfigurationInterface
1013
{
1114
const CFG_OUTPUT_PATH = 'WEBPACK_ENCORE_OUTPUT_PATH';

tests/Asset/EntrypointLookupTest.php

Lines changed: 0 additions & 106 deletions
This file was deleted.

0 commit comments

Comments
 (0)