8000 minor #49728 [Serializer] skip test using attributes on PHP 7 (xabbuh) · melya/symfony@96bbd14 · GitHub
[go: up one dir, main page]

Skip to content

Commit 96bbd14

Browse files
committed
minor symfony#49728 [Serializer] skip test using attributes on PHP 7 (xabbuh)
This PR was merged into the 5.4 branch. Discussion ---------- [Serializer] skip test using attributes on PHP 7 | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Commits ------- 7250083 skip test using attributes on PHP 7
2 parents b8c780b + 7250083 commit 96bbd14

File tree

2 files changed

+29
-12
lines changed

2 files changed

+29
-12
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Serializer\Tests\Fixtures\Attributes;
13+
14+
use Symfony\Component\Serializer\Annotation\Ignore;
15+
16+
class ClassWithIgnoreAttribute
17+
{
18+
public string $foo;
19+
20+
#[Ignore]
21+
public function isSomeIgnoredMethod(): bool
22+
{
23+
return true;
24+
}
25+
}

src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor;
1717
use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor;
1818
use Symfony\Component\PropertyInfo\PropertyInfoExtractor;
19-
use Symfony\Component\Serializer\Annotation\Ignore;
2019
use Symfony\Component\Serializer\Exception\LogicException;
2120
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
2221
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
@@ -30,6 +29,7 @@
3029
use Symfony\Component\Serializer\Serializer;
3130
use Symfony\Component\Serializer\SerializerInterface;
3231
use Symfony\Component\Serializer\Tests\Fixtures\Annotations\GroupDummy;
32+
use Symfony\Component\Serializer\Tests\Fixtures\Attributes\ClassWithIgnoreAttribute;
3333
use Symfony\Component\Serializer\Tests\Fixtures\CircularReferenceDummy;
3434
use Symfony\Component\Serializer\Tests\Fixtures\SiblingHolder;
3535
use Symfony\Component\Serializer\Tests\Normalizer\Features\CacheableObjectAttributesTestTrait;
@@ -431,6 +431,9 @@ public function testNoStaticGetSetSupport()
431431
$this->assertFalse($this->normalizer->supportsNormalization(new ObjectWithJustStaticSetterDummy()));
432432
}
433433

434+
/**
435+
* @requires PHP 8
436+
*/
434437
public function testNotIgnoredMethodSupport()
435438
{
436439
$this->assertFalse($this->normalizer->supportsNormalization(new ClassWithIgnoreAttribute()));
@@ -759,14 +762,3 @@ public function __call($key, $value)
759762
throw new \RuntimeException('__call should not be called. Called with: '.$key);
760763
}
761764
}
762-
763-
class ClassWithIgnoreAttribute
764-
{
765-
public string $foo;
766-
767-
#[Ignore]
768-
public function isSomeIgnoredMethod(): bool
769-
{
770-
return true;
771-
}
772-
}

0 commit comments

Comments
 (0)
0