mirror of
https://github.com/php/web-bugs.git
synced 2026-03-24 15:52:09 +01:00
- Added filter to phpunit config - This enables support for coverage support - Moved unit tests to dedicated directory - Also created constants for the locations of the fixtures and mocks for testing so we do not have to use relative paths in tests - Updated phpunit to 8 - Added type information to tests - Added return type and parameter type declarations for tests - Added strict types to tests - CS fixes in tests - Aligning arrays, consistent string concatenation, removed unused local vars - Added constant for test cache directory - Make the autoloader also properly work on windows - Windows does not care about the directory separator used so just trim both variant from the end.
33 lines
592 B
PHP
33 lines
592 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace App\Tests\Unit\Container;
|
|
|
|
/**
|
|
* Mock service class for testing container.
|
|
*/
|
|
class MockService
|
|
{
|
|
private $dependency;
|
|
private $property;
|
|
|
|
public function __construct(MockDependency $dependency)
|
|
{
|
|
$this->dependency = $dependency;
|
|
}
|
|
|
|
public function getDependency(): MockDependency
|
|
{
|
|
return $this->dependency;
|
|
}
|
|
|
|
public function setProperty(string $value): void
|
|
{
|
|
$this->property = $value;
|
|
}
|
|
|
|
public function getProperty(): string
|
|
{
|
|
return $this->property;
|
|
}
|
|
}
|