Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow manual test workflow triggers #144

Merged
merged 6 commits into from
Oct 13, 2024
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [2.x]
schedule:
- cron: '4 3 1 * *'
workflow_dispatch: {}

jobs:
build:
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches: [2.x, 1.x]
schedule:
- cron: '3 2 1 * *'
workflow_dispatch: {}

env:
SYMFONY_DEPRECATIONS_HELPER: "max[direct]=0"
Expand All @@ -33,7 +34,7 @@ jobs:
experimental: false
composer: v2

- deps: 'dev'
- deps: 'stable'
php: '8.3'
symfony: '7.x'
laravel: '11.x'
Expand All @@ -43,7 +44,7 @@ jobs:
- deps: 'dev'
php: '8.4'
symfony: '7.x'
laravel: '11.x'
laravel: '12.x'
experimental: true
composer: preview

Expand Down Expand Up @@ -84,14 +85,6 @@ jobs:
echo "LARAVEL_REQUIRE=$(echo '${{ matrix.laravel }}' | tr x \\*)" >> $GITHUB_ENV
fi

#if [ "${{ matrix.symfony }}" = "7.x" ]; then
# # Psalm Symfony Plugin doesn't support Symfony 7 yet
# composer remove --no-update --dev vimeo/psalm psalm/plugin-symfony

# # Carbon needs version 3
# composer require --no-update nesbot/carbon:"3.x-dev as 2.99.0"
#fi

echo "PHP_VERSION=${{ matrix.php }}" >> $GITHUB_ENV

- name: Cache dependencies
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
"illuminate/database": "^9.0 || ^10.0 || ^11.0",
"illuminate/events": "^9.0 || ^10.0 || ^11.0",
"illuminate/console": "^9.39 || ^10.0 || ^11.0",
"laravel/serializable-closure": "^1.0",
"symfony/framework-bundle": "^6.0 || ^7.0",
"symfony/dependency-injection": "^6.0 || ^7.0",
"jdorn/sql-formatter": "^1.2.17"
},
"require-dev": {
"doctrine/annotations": "1.*",
"symfony/maker-bundle": "^1.44",
"symfony/maker-bundle": "^1.49",
"mockery/mockery": "^1.6",
"symfony/console": "^6.0 || ^7.0",
"symfony/event-dispatcher": "^6.0 || ^7.0",
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/WouterJEloquentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\DependencyInjection\Reference;
use Illuminate\Database\Events\QueryExecuted;
Expand Down
1 change: 1 addition & 0 deletions src/Factory/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public function modelName(): string
return str_replace('\\Factory\\', '\\Model\\', $name);
};

/** @psalm-suppress RedundantPropertyInitializationCheck the model is incorrectly typed as not being able to be null */
return $this->model ?? $resolver($this);
}
}
7 changes: 6 additions & 1 deletion tests/Maker/MakerTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ private function callGenerate(array $input)
$app = new Application();
$app->setAutoExit(false);
$app->add(
(new MakerCommand($this->maker, \Mockery::spy(FileManager::class), $this->generator ?? \Mockery::spy(Generator::class), class_exists(TemplateLinter::class) ? new TemplateLinter() : null))
(new MakerCommand(
$this->maker,
$fileManager = \Mockery::spy(FileManager::class),
$this->generator ?? \Mockery::spy(Generator::class),
new TemplateLinter(method_exists(Generator::class, 'generateClassFromClassData') ? $fileManager : null)
))
->setName($this->maker->getCommandName())
);

Expand Down
Loading