name: DateIntervalNormalizerTest class_comment: "# * @author J\xE9r\xF4me Parmentier " dependencies: - name: TestCase type: class source: PHPUnit\Framework\TestCase - name: InvalidArgumentException type: class source: Symfony\Component\Serializer\Exception\InvalidArgumentException - name: NotNormalizableValueException type: class source: Symfony\Component\Serializer\Exception\NotNormalizableValueException - name: DateIntervalNormalizer type: class source: Symfony\Component\Serializer\Normalizer\DateIntervalNormalizer properties: [] methods: - name: testNormalizeUsingFormatPassedInContext visibility: public parameters: - name: format - name: output - name: input comment: "# * @author J\xE9r\xF4me Parmentier \n# */\n# class\ \ DateIntervalNormalizerTest extends TestCase\n# {\n# private DateIntervalNormalizer\ \ $normalizer;\n# \n# protected function setUp(): void\n# {\n# $this->normalizer\ \ = new DateIntervalNormalizer();\n# }\n# \n# public static function dataProviderISO():\ \ array\n# {\n# return [\n# ['P%YY%MM%DDT%HH%IM%SS', 'P00Y00M00DT00H00M00S', 'PT0S'],\n\ # ['P%yY%mM%dDT%hH%iM%sS', 'P0Y0M0DT0H0M0S', 'PT0S'],\n# ['P%yY%mM%dDT%hH%iM%sS',\ \ 'P10Y2M3DT16H5M6S', 'P10Y2M3DT16H5M6S'],\n# ['P%yY%mM%dDT%hH%iM', 'P10Y2M3DT16H5M',\ \ 'P10Y2M3DT16H5M'],\n# ['P%yY%mM%dDT%hH', 'P10Y2M3DT16H', 'P10Y2M3DT16H'],\n\ # ['P%yY%mM%dD', 'P10Y2M3D', 'P10Y2M3DT0H'],\n# ['%RP%yY%mM%dD', '-P10Y2M3D',\ \ '-P10Y2M3DT0H'],\n# ['%RP%yY%mM%dD', '+P10Y2M3D', '+P10Y2M3DT0H'],\n# ['%RP%yY%mM%dD',\ \ '+P10Y2M3D', 'P10Y2M3DT0H'],\n# ['%rP%yY%mM%dD', '-P10Y2M3D', '-P10Y2M3DT0H'],\n\ # ['%rP%yY%mM%dD', 'P10Y2M3D', 'P10Y2M3DT0H'],\n# ];\n# }\n# \n# public function\ \ testSupportsNormalization()\n# {\n# $this->assertTrue($this->normalizer->supportsNormalization(new\ \ \\DateInterval('P00Y00M00DT00H00M00S')));\n# $this->assertFalse($this->normalizer->supportsNormalization(new\ \ \\stdClass()));\n# }\n# \n# public function testNormalize()\n# {\n# $this->assertEquals('P0Y0M0DT0H0M0S',\ \ $this->normalizer->normalize(new \\DateInterval('PT0S')));\n# }\n# \n# /**\n\ # * @dataProvider dataProviderISO" - name: testNormalizeUsingFormatPassedInConstructor visibility: public parameters: - name: format - name: output - name: input comment: '# * @dataProvider dataProviderISO' - name: testNormalizeInvalidObjectThrowsException visibility: public parameters: [] comment: null - name: testSupportsDenormalization visibility: public parameters: [] comment: null - name: testDenormalize visibility: public parameters: [] comment: null - name: testDenormalizeUsingFormatPassedInContext visibility: public parameters: - name: format - name: input - name: output comment: '# * @dataProvider dataProviderISO' - name: testDenormalizeUsingFormatPassedInConstructor visibility: public parameters: - name: format - name: input - name: output comment: '# * @dataProvider dataProviderISO' - name: testDenormalizeIntervalsWithOmittedPartsBeingZero visibility: public parameters: [] comment: null - name: testDenormalizeIntervalWithBothWeeksAndDays visibility: public parameters: [] comment: null - name: testDenormalizeExpectsString visibility: public parameters: [] comment: null - name: testDenormalizeNonISO8601IntervalStringThrowsException visibility: public parameters: [] comment: null - name: testDenormalizeInvalidDataThrowsException visibility: public parameters: [] comment: null - name: testDenormalizeFormatMismatchThrowsException visibility: public parameters: [] comment: null - name: assertDateIntervalEquals visibility: private parameters: - name: expected - name: actual comment: null - name: getInterval visibility: private parameters: - name: data comment: null traits: - PHPUnit\Framework\TestCase - Symfony\Component\Serializer\Exception\InvalidArgumentException - Symfony\Component\Serializer\Exception\NotNormalizableValueException - Symfony\Component\Serializer\Normalizer\DateIntervalNormalizer interfaces: []