Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ jobs:
- "8.3"
- "8.4"
- "8.5"
- "8.6"

steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v7

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -35,7 +36,7 @@ jobs:
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v3
uses: actions/cache@v6
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
Expand All @@ -48,6 +49,6 @@ jobs:
run: vendor/bin/phpunit --colors=always --coverage-clover clover.xml

- name: Send code coverage report to Codecov.io
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
5 changes: 3 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ jobs:
- "8.3"
- "8.4"
- "8.5"
- "8.6"

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -35,7 +36,7 @@ jobs:
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Documentation is available at: https://docs.dotkernel.org/dot-maker/.
[![GitHub stars](https://img.shields.io/github/stars/dotkernel/dot-maker)](https://github.com/dotkernel/dot-maker/stargazers)
[![GitHub license](https://img.shields.io/github/license/dotkernel/dot-maker)](https://github.com/dotkernel/dot-maker/blob/2.0/LICENSE)

[![Build Static](https://github.com/dotkernel/dot-maker/actions/workflows/continuous-integration.yml/badge.svg?branch=2.0)](https://github.com/dotkernel/dot-maker/actions/workflows/continuous-integration.yml)
[![Build Static](https://github.com/dotkernel/dot-maker/actions/workflows/continuous-integration.yml/badge.svg?branch=2.x)](https://github.com/dotkernel/dot-maker/actions/workflows/continuous-integration.yml)
[![codecov](https://codecov.io/gh/dotkernel/dot-maker/graph/badge.svg?token=KT9UA402B4)](https://codecov.io/gh/dotkernel/dot-maker)
[![PHPStan](https://github.com/dotkernel/dot-maker/actions/workflows/static-analysis.yml/badge.svg?branch=2.0)](https://github.com/dotkernel/dot-maker/actions/workflows/static-analysis.yml)
[![PHPStan](https://github.com/dotkernel/dot-maker/actions/workflows/static-analysis.yml/badge.svg?branch=2.x)](https://github.com/dotkernel/dot-maker/actions/workflows/static-analysis.yml)

## Installation

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
}
},
"require": {
"php": "~8.3.0 || ~8.4.0 || ~8.5.0"
"php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0"
},
"require-dev": {
"boundwize/structarmed": "^0.19",
"laminas/laminas-coding-standard": "^3.1.0",
"mikey179/vfsstream": "^1.6.12",
"phpstan/phpstan": "^2.1.33",
"phpstan/phpstan-phpunit": "^2.0.10",
"phpunit/phpunit": "^10.5.60"
"phpunit/phpunit": "^12.5.22"
},
"scripts": {
"check": [
Expand Down
4 changes: 2 additions & 2 deletions docs/book/v2/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Programmatically generate Dotkernel project files and directories.
[![GitHub stars](https://img.shields.io/github/stars/dotkernel/dot-maker)](https://github.com/dotkernel/dot-maker/stargazers)
[![GitHub license](https://img.shields.io/github/license/dotkernel/dot-maker)](https://github.com/dotkernel/dot-maker/blob/2.0/LICENSE)

[![Build Static](https://github.com/dotkernel/dot-maker/actions/workflows/continuous-integration.yml/badge.svg?branch=2.0)](https://github.com/dotkernel/dot-maker/actions/workflows/continuous-integration.yml)
[![Build Static](https://github.com/dotkernel/dot-maker/actions/workflows/continuous-integration.yml/badge.svg?branch=2.x)](https://github.com/dotkernel/dot-maker/actions/workflows/continuous-integration.yml)
[![codecov](https://codecov.io/gh/dotkernel/dot-maker/graph/badge.svg?token=KT9UA402B4)](https://codecov.io/gh/dotkernel/dot-maker)
[![PHPStan](https://github.com/dotkernel/dot-maker/actions/workflows/static-analysis.yml/badge.svg?branch=2.0)](https://github.com/dotkernel/dot-maker/actions/workflows/static-analysis.yml)
[![PHPStan](https://github.com/dotkernel/dot-maker/actions/workflows/static-analysis.yml/badge.svg?branch=2.x)](https://github.com/dotkernel/dot-maker/actions/workflows/static-analysis.yml)

Make sure you run through our guides on using the [inputs](./io/input.md) and the [outputs](./io/output.md).

Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.5/phpunit.xsd"
bootstrap="./vendor/autoload.php"
colors="true">
<testsuites>
Expand Down
2 changes: 2 additions & 0 deletions test/FileSystem/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use org\bovigo\vfs\vfsStream;
use org\bovigo\vfs\vfsStreamContent;
use org\bovigo\vfs\vfsStreamDirectory;
use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations;
use PHPUnit\Framework\TestCase;

use function sprintf;
Expand Down Expand Up @@ -45,6 +46,7 @@ public function testWillInstantiate(): void
$this->assertContainsOnlyInstancesOf(File::class, [$file]);
}

#[AllowMockObjectsWithoutExpectations]
public function testFailingToCreateWillThrowAnError(): void
{
$file = $this->getMockBuilder(File::class)
Expand Down
25 changes: 11 additions & 14 deletions test/IO/InputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Dot\Maker\IO\Input;
use Dot\Maker\IO\Output;
use PHPUnit\Framework\Attributes\TestWith;
use PHPUnit\Framework\TestCase;

use function fclose;
Expand Down Expand Up @@ -60,13 +61,11 @@ public function testPromptWillOutputMessageAndReadInput(): void
fclose($outputStream);
}

/**
* @testWith [""]
* ["y"]
* ["yes"]
* ["Y"]
* ["Yes"]
*/
#[TestWith([''])]
#[TestWith(['y'])]
#[TestWith(['yes'])]
#[TestWith(['Y'])]
#[TestWith(['Yes'])]
public function testConfirmWillOutputMessageAndReadPositiveAnswer(string $input): void
{
$outputStream = fopen('php://memory', 'w+');
Expand All @@ -86,13 +85,11 @@ public function testConfirmWillOutputMessageAndReadPositiveAnswer(string $input)
fclose($outputStream);
}

/**
* @testWith [""]
* ["n"]
* ["no"]
* ["N"]
* ["No"]
*/
#[TestWith([''])]
#[TestWith(['n'])]
#[TestWith(['no'])]
#[TestWith(['N'])]
#[TestWith(['No'])]
public function testConfirmWillOutputMessageAndReadNegativeAnswer(string $input): void
{
$outputStream = fopen('php://memory', 'w+');
Expand Down
2 changes: 2 additions & 0 deletions test/MakerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Dot\Maker\IO\Output;
use Dot\Maker\Maker;
use org\bovigo\vfs\vfsStream;
use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations;
use PHPUnit\Framework\TestCase;

use function fclose;
Expand All @@ -19,6 +20,7 @@

use const PHP_EOL;

#[AllowMockObjectsWithoutExpectations]
class MakerTest extends TestCase
{
/** @var resource $outputStream */
Expand Down
9 changes: 3 additions & 6 deletions test/Type/CommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Dot\Maker\Type\Command;
use Dot\Maker\Type\Module;
use org\bovigo\vfs\vfsStream;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

use function fclose;
Expand Down Expand Up @@ -147,9 +148,7 @@ public function testCallToInvokeWillOutputErrorAndWillNotCreateFileWhenNameIsInv
$this->assertFileDoesNotExist($file->getPath());
}

/**
* @dataProvider dataProviderWithoutService
*/
#[DataProvider('dataProviderWithoutService')]
public function testCallToInvokeWithoutServiceWillSucceedWhenNameIsValid(string $expected): void
{
$file = $this->fileSystem->command($this->resourceName);
Expand Down Expand Up @@ -191,9 +190,7 @@ public function testCallToInvokeWithServiceWillSucceedWhenNameIsValid(): void
$this->assertSame($this->dataProviderWithService($serviceInterface), $file->read());
}

/**
* @dataProvider dataProviderWithoutService
*/
#[DataProvider('dataProviderWithoutService')]
public function testCallToCreateWithoutServiceWillSucceedWhenNameIsValid(string $expected): void
{
$file = $this->fileSystem->command($this->resourceName);
Expand Down
9 changes: 3 additions & 6 deletions test/Type/EntityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Dot\Maker\Type\Entity;
use Dot\Maker\Type\Module;
use org\bovigo\vfs\vfsStream;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

use function fclose;
Expand Down Expand Up @@ -145,9 +146,7 @@ public function testCallToInvokeWillOutputErrorAndWillNotCreateFileWhenNameIsInv
$this->assertFileDoesNotExist($file->getPath());
}

/**
* @dataProvider dataProvider
*/
#[DataProvider('dataProvider')]
public function testCallToInvokeWillSucceedWhenNameIsValid(string $expected): void
{
$file = $this->fileSystem->entity($this->resourceName);
Expand All @@ -166,9 +165,7 @@ public function testCallToInvokeWillSucceedWhenNameIsValid(string $expected): vo
$this->assertSame($expected, $file->read());
}

/**
* @dataProvider dataProvider
*/
#[DataProvider('dataProvider')]
public function testCallToCreateWillSucceedWhenNameIsValid(string $expected): void
{
$file = $this->fileSystem->entity($this->resourceName);
Expand Down
9 changes: 3 additions & 6 deletions test/Type/RepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Dot\Maker\Type\Module;
use Dot\Maker\Type\Repository;
use org\bovigo\vfs\vfsStream;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

use function fclose;
Expand Down Expand Up @@ -145,9 +146,7 @@ public function testCallToInvokeWillOutputErrorAndWillNotCreateFileWhenNameIsInv
$this->assertFileDoesNotExist($file->getPath());
}

/**
* @dataProvider dataProvider
*/
#[DataProvider('dataProvider')]
public function testCallToInvokeWillSucceedWhenNameIsValid(string $expected): void
{
$file = $this->fileSystem->repository($this->resourceName);
Expand All @@ -166,9 +165,7 @@ public function testCallToInvokeWillSucceedWhenNameIsValid(string $expected): vo
$this->assertSame($expected, $file->read());
}

/**
* @dataProvider dataProvider
*/
#[DataProvider('dataProvider')]
public function testCallToCreateWillSucceedWhenNameIsValid(string $expected): void
{
$file = $this->fileSystem->repository($this->resourceName);
Expand Down
9 changes: 3 additions & 6 deletions test/Type/RoutesDelegatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Dot\Maker\IO\Output;
use Dot\Maker\Type\RoutesDelegator;
use org\bovigo\vfs\vfsStream;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

use function fclose;
Expand All @@ -26,9 +27,7 @@ class RoutesDelegatorTest extends TestCase
private string $moduleName = 'ModuleName';
private string $resourceName = 'BookStore';

/**
* @dataProvider dataProvider
*/
#[DataProvider('dataProvider')]
public function testCallToCreateWhenProjectTypeIsNotApiWillCreateFile(string $expected): void
{
$stream = fopen('php://memory', 'w+');
Expand Down Expand Up @@ -73,9 +72,7 @@ public function testCallToCreateWhenProjectTypeIsNotApiWillCreateFile(string $ex
fclose($stream);
}

/**
* @dataProvider dataProviderApi
*/
#[DataProvider('dataProviderApi')]
public function testCallToCreateWhenProjectTypeIsApiWillCreateFile(string $expected): void
{
$stream = fopen('php://memory', 'w+');
Expand Down
Loading