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

PHPStan for tests folder #1132

Merged
merged 1 commit into from
May 6, 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 composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"nextras/dbal": "^4.0",
"nextras/orm": "^4.0",
"phpstan/phpstan-deprecation-rules": "^1.1",
"phpstan/phpstan-mockery": "^1.1",
"phpstan/phpstan-nette": "^1.0.0",
"phpstan/phpstan-strict-rules": "^1.4",
"tharos/leanmapper": "^3.4.2 || ^4.0.0",
Expand Down
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ includes:
- vendor/phpstan/phpstan-nette/extension.neon
- vendor/phpstan/phpstan-nette/rules.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/phpstan/phpstan-mockery/extension.neon

parameters:
level: 8

paths:
- src
- tests

checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
Expand Down
1 change: 1 addition & 0 deletions tests/Files/TestPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ protected function createComponentGrid(): TestGridControl

protected function createTemplate(?string $class = null): Template
{
// @phpstan-ignore-next-line
return Mockery::mock(Template::class)
->shouldReceive('getFile')
->andReturn(__DIR__ . '/template.latte')
Expand Down
2 changes: 2 additions & 0 deletions tests/Files/TestingDatagridFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Contributte\Datagrid\Datagrid;
use Nette\Application\PresenterFactory;
use Nette\Application\UI\Presenter;
use Nette\Http\Request;
use Nette\Http\Response;
use Nette\Http\Session;
Expand All @@ -17,6 +18,7 @@ public function createTestingDatagrid(string $presenterName = 'Testing'): Datagr
$presenterFactory = new PresenterFactory();
$presenterFactory->setMapping(['*' => 'Contributte\Datagrid\Tests\Files\*Presenter']);

/** @var Presenter $presenter */
$presenter = $presenterFactory->createPresenter($presenterName);

$url = new UrlScript('http://localhost');
Expand Down
2 changes: 2 additions & 0 deletions tests/Files/TestingDatagridFactoryRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Nette\Application\PresenterFactory;
use Nette\Application\Request;
use Nette\Application\Routers\SimpleRouter;
use Nette\Application\UI\Presenter;
use Nette\ComponentModel\IComponent;
use Nette\Http\Request as HttpRequest;
use Nette\Http\Response;
Expand All @@ -19,6 +20,7 @@ public function createTestingDatagrid(): ?IComponent
$presenterFactory = new PresenterFactory();
$presenterFactory->setMapping(['*' => 'Contributte\Datagrid\Tests\Files\*Presenter']);

/** @var Presenter $presenter */
$presenter = $presenterFactory->createPresenter('Test');

$url = new UrlScript('http://localhost/index.php');
Expand Down
Loading