Skip to content

Commit

Permalink
Merge pull request #197 from apiato/refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi authored Jan 31, 2024
2 parents 03e2bef + 41869c9 commit 97fc3cd
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 11 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"require-dev": {
"fakerphp/faker": "^1.19.1",
"friendsofphp/php-cs-fixer": "^3.8.0",
"jetbrains/phpstorm-attributes": "^1.0",
"mockery/mockery": "^1.4.4",
"orchestra/testbench": "^8.15",
"php-standard-library/psalm-plugin": "^2.3",
Expand Down
44 changes: 43 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions src/Abstracts/Providers/MiddlewareServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ abstract class MiddlewareServiceProvider extends MainServiceProvider
* The application's route middleware.
*
* @var array<string, class-string|string>
*
* @deprecated
*/
protected array $routeMiddleware = [];

Expand Down
2 changes: 1 addition & 1 deletion src/Generator/GeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ protected function getStubContent(): string
// Check if the custom file exists
if (!$this->fileSystem->exists($file)) {
// It does not exist - so take the default file!
$path = __DIR__ . 'GeneratorCommand.php/' . self::STUB_PATH;
$path = __DIR__ . '/' . self::STUB_PATH;
$file = str_replace('*', $this->stubName, $path);
}

Expand Down
2 changes: 0 additions & 2 deletions src/Loaders/ProvidersLoaderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

trait ProvidersLoaderTrait
{
public array $serviceProviders = [];

/**
* Loads only the Main Service Providers from the Containers.
* All the Service Providers (registered inside the main), will be
Expand Down
10 changes: 5 additions & 5 deletions src/Traits/TestTraits/PhpUnit/TestAssertionHelperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,23 @@ protected function getInaccessiblePropertyValue(object $object, string $property
}

/**
* Create a spy for a task with a specified repository instance.
* Create a spy for an Action, SubAction or a Task that uses a repository.
*
* @param string $taskClassName the task class name
* @param string $className the Action, SubAction or a Task class name
* @param string $repositoryClassName the repository class name
*/
protected function createTaskSpyWithRepository(string $taskClassName, string $repositoryClassName, bool $allowRun = true): MockInterface
protected function createSpyWithRepository(string $className, string $repositoryClassName, bool $allowRun = true): MockInterface
{
/** @var MockInterface $taskSpy */
$taskSpy = \Mockery::mock($taskClassName, [app($repositoryClassName)])
$taskSpy = \Mockery::mock($className, [app($repositoryClassName)])
->shouldIgnoreMissing(null, true)
->makePartial();

if ($allowRun) {
$taskSpy->allows('run')->andReturn();
}

$this->swap($taskClassName, $taskSpy);
$this->swap($className, $taskSpy);

return $taskSpy;
}
Expand Down

0 comments on commit 97fc3cd

Please sign in to comment.