remove contract test

This commit is contained in:
Yisroel Baum 2026-06-01 21:46:51 +03:00
parent d334745ade
commit f811c078f9
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
2 changed files with 3 additions and 24 deletions

View file

@ -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)`).

View file

@ -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(),
);
}
}