remove contract test
This commit is contained in:
parent
d334745ade
commit
f811c078f9
2 changed files with 3 additions and 24 deletions
|
|
@ -20,6 +20,9 @@ intentionally omitted here - update this section as entities land.
|
||||||
- Do not write unit tests for concrete repository implementations
|
- Do not write unit tests for concrete repository implementations
|
||||||
(e.g. `Postgres*Repository`). They are exercised by e2e tests.
|
(e.g. `Postgres*Repository`). They are exercised by e2e tests.
|
||||||
Use cases are tested with fake repositories.
|
Use cases are tested with fake repositories.
|
||||||
|
- Do not write reflection-only contract tests for repository interface
|
||||||
|
method names, parameter counts, parameter names, or type hints. PHP
|
||||||
|
interfaces already enforce those signatures; test behavior instead.
|
||||||
- Repository methods that find records by a foreign key should accept
|
- Repository methods that find records by a foreign key should accept
|
||||||
the related entity, not a raw id (e.g. `findBySet(Set $set)`, not
|
the related entity, not a raw id (e.g. `findBySet(Set $set)`, not
|
||||||
`findBySetId(int $setId)`).
|
`findBySetId(int $setId)`).
|
||||||
|
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Tests\Unit\Element;
|
|
||||||
|
|
||||||
use App\Element\Element;
|
|
||||||
use App\Element\ElementRepository;
|
|
||||||
use ReflectionMethod;
|
|
||||||
use Tests\TestCase;
|
|
||||||
|
|
||||||
class ElementRepositoryContractTest extends TestCase
|
|
||||||
{
|
|
||||||
public function testUpdateAcceptsOnlyElement(): void
|
|
||||||
{
|
|
||||||
$method = new ReflectionMethod(ElementRepository::class, 'update');
|
|
||||||
$parameters = $method->getParameters();
|
|
||||||
|
|
||||||
$this->assertCount(1, $parameters);
|
|
||||||
$this->assertSame('element', $parameters[0]->getName());
|
|
||||||
$this->assertSame(
|
|
||||||
Element::class,
|
|
||||||
$parameters[0]->getType()->getName(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue