Skip to content

Commit

Permalink
test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
DjordyKoert committed Oct 24, 2024
1 parent 1d87a9a commit d67e4d1
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 75 deletions.
4 changes: 0 additions & 4 deletions tests/Functional/BazingaFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@ public function testWithGroup(): void

public function testWithType(): void
{
if (!method_exists(Embedded::class, 'getType')) {
self::markTestSkipped('Typed embedded properties require at most willdurand/hateoas 3.0');
}

self::assertEquals([
'type' => 'object',
'properties' => [
Expand Down
30 changes: 14 additions & 16 deletions tests/Functional/EntityExcluded/BazingaUserTyped.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,20 @@

use Hateoas\Configuration\Annotation as Hateoas;

/**
* @Hateoas\Relation(
* name="typed_bazinga_users",
* embedded=@Hateoas\Embedded(
* "expr(service('zz'))",
* type="array<Nelmio\ApiDocBundle\Tests\Functional\Entity\BazingaUser>"
* )
* )
* @Hateoas\Relation(
* name="typed_bazinga_name",
* embedded=@Hateoas\Embedded(
* "expr(service('yy'))",
* type="string"
* )
* )
*/
#[Hateoas\Relation(
name: "typed_bazinga_users",
embedded: new Hateoas\Embedded(
content: "expr(service('zz'))",
type: "array<Nelmio\ApiDocBundle\Tests\Functional\Entity\BazingaUser>"
)
)]
#[Hateoas\Relation(
name: "typed_bazinga_name",
embedded: new Hateoas\Embedded(
content: "expr(service('yy'))",
type: "string"
)
)]
class BazingaUserTyped
{
}
36 changes: 0 additions & 36 deletions tests/Functional/EntityExcluded/SerializedNameEnt.php

This file was deleted.

10 changes: 1 addition & 9 deletions tests/Functional/FunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,15 +587,7 @@ public function testNoDuplicatedParameters(): void

public function testSerializedNameAction(): void
{
if (!class_exists(SerializedName::class)) {
self::markTestSkipped('Annotation @SerializedName doesn\'t exist.');
}

if (TestKernel::isAttributesAvailable()) {
$model = $this->getModel('SerializedNameEntity');
} else {
$model = $this->getModel('SerializedNameEnt');
}
$model = $this->getModel('SerializedNameEntity');

self::assertCount(2, $model->properties);

Expand Down
6 changes: 0 additions & 6 deletions tests/Functional/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,6 @@ protected function configureRoutes(RoutingConfigurator $routes): void

if (self::USE_BAZINGA === $this->flag) {
$routes->withPath('/')->import(__DIR__.'/Controller/BazingaTypedController.php', self::isAnnotationsAvailable() ? 'annotation' : 'attribute');

try {
new \ReflectionMethod(Embedded::class, 'getType');
$routes->withPath('/')->import(__DIR__.'/Controller/BazingaTypedController.php', self::isAnnotationsAvailable() ? 'annotation' : 'attribute');
} catch (\ReflectionException $e) {
}
}

if (self::USE_FOSREST === $this->flag) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ public function testUpdatePropertyFix1283(): void
*/
public function testOptionalProperty($entity): void
{
if (!\property_exists(Assert\NotBlank::class, 'allowNull')) {
self::markTestSkipped('NotBlank::allowNull was added in symfony/validator 4.3.');
}

$schema = $this->createObj(OA\Schema::class, []);
$schema->merge([$this->createObj(OA\Property::class, ['property' => 'property1'])]);
$schema->merge([$this->createObj(OA\Property::class, ['property' => 'property2'])]);
Expand Down

0 comments on commit d67e4d1

Please sign in to comment.