Skip to content

Commit 00bb7c2

Browse files
committed
move hooks support in another pr
1 parent 8b56b9e commit 00bb7c2

File tree

2 files changed

+0
-50
lines changed

2 files changed

+0
-50
lines changed

tests/Unit/Fixture/PropertyHooks.php

Lines changed: 0 additions & 22 deletions
This file was deleted.

tests/Unit/MetadataHydratorTest.php

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@
3030
use Patchlevel\Hydrator\Tests\Unit\Fixture\ProfileCreatedWithNormalizer;
3131
use Patchlevel\Hydrator\Tests\Unit\Fixture\ProfileCreatedWrapper;
3232
use Patchlevel\Hydrator\Tests\Unit\Fixture\ProfileId;
33-
use Patchlevel\Hydrator\Tests\Unit\Fixture\PropertyHooks;
3433
use Patchlevel\Hydrator\Tests\Unit\Fixture\Skill;
3534
use Patchlevel\Hydrator\Tests\Unit\Fixture\Status;
3635
use Patchlevel\Hydrator\Tests\Unit\Fixture\StatusWithNormalizer;
3736
use Patchlevel\Hydrator\Tests\Unit\Fixture\WrongNormalizer;
3837
use Patchlevel\Hydrator\TypeMismatch;
39-
use PHPUnit\Framework\Attributes\RequiresPhp;
4038
use PHPUnit\Framework\TestCase;
4139
use Prophecy\PhpUnit\ProphecyTrait;
4240

@@ -128,18 +126,6 @@ public function testExtractWithHooks(): void
128126
self::assertEquals(['postHydrateCalled' => false, 'preExtractCalled' => true], $data);
129127
}
130128

131-
#[RequiresPhp('8.4')]
132-
public function testExtractWithPropertyHooks(): void
133-
{
134-
$data = $this->hydrator->extract(new PropertyHooks('David', 'Badura'));
135-
136-
self::assertEquals([
137-
'firstName' => 'David',
138-
'lastName' => 'Badura',
139-
'fullName' => 'David Badura',
140-
], $data);
141-
}
142-
143129
public function testHydrate(): void
144130
{
145131
$expected = new ProfileCreated(
@@ -392,18 +378,4 @@ public function testHydrateWithHooks(): void
392378
self::assertEquals(true, $object->postHydrateCalled);
393379
self::assertEquals(false, $object->preExtractCalled);
394380
}
395-
396-
#[RequiresPhp('8.4')]
397-
public function testHydrateWithPropertyHooks(): void
398-
{
399-
$object = $this->hydrator->hydrate(PropertyHooks::class, [
400-
'firstName' => 'David',
401-
'lastName' => 'Badura',
402-
]);
403-
404-
self::assertEquals(new PropertyHooks(
405-
'David',
406-
'Badura',
407-
), $object);
408-
}
409381
}

0 commit comments

Comments
 (0)