Files
archived-web-bugs/tests/Unit/Container/MockService.php
Pieter Hordijk f762db348d Add tests fixes
- 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.
2019-05-16 22:05:30 +02:00

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;
}
}