diff --git a/tests/VObject/AttachIssueTest.php b/tests/VObject/AttachIssueTest.php index 74c93cd0..6f8981a3 100644 --- a/tests/VObject/AttachIssueTest.php +++ b/tests/VObject/AttachIssueTest.php @@ -17,6 +17,6 @@ public function testRead(): void ICS; $obj = Reader::read($event); - $this->assertEquals($event, $obj->serialize()); + self::assertEquals($event, $obj->serialize()); } } diff --git a/tests/VObject/BirthdayCalendarGeneratorTest.php b/tests/VObject/BirthdayCalendarGeneratorTest.php index 3ebc6d98..ac69d1f0 100644 --- a/tests/VObject/BirthdayCalendarGeneratorTest.php +++ b/tests/VObject/BirthdayCalendarGeneratorTest.php @@ -39,7 +39,7 @@ public function testVcardStringWithValidBirthday(): void $generator->setObjects($input); $output = $generator->getResult(); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $expected, $output ); @@ -97,7 +97,7 @@ public function testArrayOfVcardStringsWithValidBirthdays(): void $generator->setObjects($input); $output = $generator->getResult(); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $expected, $output ); @@ -156,7 +156,7 @@ public function testArrayOfVcardStringsWithValidBirthdaysViaConstructor(): void $generator->setObjects($input); $output = $generator->getResult(); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $expected, $output ); @@ -195,7 +195,7 @@ public function testVcardObjectWithValidBirthday(): void $generator->setObjects($input); $output = $generator->getResult(); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $expected, $output ); @@ -257,7 +257,7 @@ public function testArrayOfVcardObjectsWithValidBirthdays(): void $generator->setObjects($input); $output = $generator->getResult(); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $expected, $output ); @@ -294,7 +294,7 @@ public function testVcardStringWithValidBirthdayWithXAppleOmitYear(): void $generator->setObjects($input); $output = $generator->getResult(); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $expected, $output ); @@ -331,7 +331,7 @@ public function testVcardStringWithValidBirthdayWithoutYear(): void $generator->setObjects($input); $output = $generator->getResult(); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $expected, $output ); @@ -359,7 +359,7 @@ public function testVcardStringWithInvalidBirthday(): void $generator->setObjects($input); $output = $generator->getResult(); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $expected, $output ); @@ -386,7 +386,7 @@ public function testVcardStringWithNoBirthday(): void $generator->setObjects($input); $output = $generator->getResult(); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $expected, $output ); @@ -424,7 +424,7 @@ public function testVcardStringWithValidBirthdayLocalized(): void $generator->setFormat('%1$s\'s Geburtstag'); $output = $generator->getResult(); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $expected, $output ); @@ -452,7 +452,7 @@ public function testVcardStringWithEmptyBirthdayProperty(): void $generator->setObjects($input); $output = $generator->getResult(); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $expected, $output ); @@ -534,7 +534,7 @@ public function testBrokenVcardWithoutFN(): void $generator->setObjects($input); $output = $generator->getResult(); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $expected, $output ); diff --git a/tests/VObject/CliTest.php b/tests/VObject/CliTest.php index 083f3601..c57d2522 100644 --- a/tests/VObject/CliTest.php +++ b/tests/VObject/CliTest.php @@ -28,89 +28,89 @@ public function setUp(): void public function testInvalidArg(): void { - $this->assertEquals( + self::assertEquals( 1, $this->cli->main(['vobject', '--hi']) ); rewind($this->cli->stderr); - $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100); + self::assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100); } public function testQuiet(): void { - $this->assertEquals( + self::assertEquals( 1, $this->cli->main(['vobject', '-q']) ); - $this->assertTrue($this->cli->quiet); + self::assertTrue($this->cli->quiet); rewind($this->cli->stderr); - $this->assertEquals(0, strlen(stream_get_contents($this->cli->stderr))); + self::assertEquals(0, strlen(stream_get_contents($this->cli->stderr))); } public function testHelp(): void { - $this->assertEquals( + self::assertEquals( 0, $this->cli->main(['vobject', '-h']) ); rewind($this->cli->stderr); - $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100); + self::assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100); } public function testFormat(): void { - $this->assertEquals( + self::assertEquals( 1, $this->cli->main(['vobject', '--format=jcard']) ); rewind($this->cli->stderr); - $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100); + self::assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100); - $this->assertEquals('jcard', $this->cli->format); + self::assertEquals('jcard', $this->cli->format); } public function testFormatInvalid(): void { - $this->assertEquals( + self::assertEquals( 1, $this->cli->main(['vobject', '--format=foo']) ); rewind($this->cli->stderr); - $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100); + self::assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100); - $this->assertNull($this->cli->format); + self::assertNull($this->cli->format); } public function testInputFormatInvalid(): void { - $this->assertEquals( + self::assertEquals( 1, $this->cli->main(['vobject', '--inputformat=foo']) ); rewind($this->cli->stderr); - $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100); + self::assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100); - $this->assertNull($this->cli->format); + self::assertNull($this->cli->format); } public function testNoInputFile(): void { - $this->assertEquals( + self::assertEquals( 1, $this->cli->main(['vobject', 'color']) ); rewind($this->cli->stderr); - $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100); + self::assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100); } public function testTooManyArgs(): void { - $this->assertEquals( + self::assertEquals( 1, $this->cli->main(['vobject', 'color', 'a', 'b', 'c']) ); @@ -118,7 +118,7 @@ public function testTooManyArgs(): void public function testUnknownCommand(): void { - $this->assertEquals( + self::assertEquals( 1, $this->cli->main(['vobject', 'foo', '-']) ); @@ -138,14 +138,14 @@ public function testConvertJson(): void rewind($inputStream); $this->cli->stdin = $inputStream; - $this->assertEquals( + self::assertEquals( 0, $this->cli->main(['vobject', 'convert', '--format=json', '-']) ); rewind($this->cli->stdout); $version = Version::VERSION; - $this->assertEquals( + self::assertEquals( '["vcard",[["version",{},"text","4.0"],["prodid",{},"text","-\/\/Sabre\/\/Sabre VObject '.$version.'\/\/EN"],["fn",{},"text","Cowboy Henk"]]]', stream_get_contents($this->cli->stdout) ); @@ -169,7 +169,7 @@ public function testConvertJCardPretty(): void rewind($inputStream); $this->cli->stdin = $inputStream; - $this->assertEquals( + self::assertEquals( 0, $this->cli->main(['vobject', 'convert', '--format=jcard', '--pretty', '-']) ); @@ -186,7 +186,7 @@ public function testConvertJCardPretty(): void "versi JCARD; - $this->assertStringStartsWith( + self::assertStringStartsWith( $expected, stream_get_contents($this->cli->stdout) ); @@ -206,7 +206,7 @@ public function testConvertJCalFail(): void rewind($inputStream); $this->cli->stdin = $inputStream; - $this->assertEquals( + self::assertEquals( 2, $this->cli->main(['vobject', 'convert', '--format=jcal', '--inputformat=mimedir', '-']) ); @@ -251,7 +251,7 @@ public function testConvertMimeDir(): void rewind($inputStream); $this->cli->stdin = $inputStream; - $this->assertEquals( + self::assertEquals( 0, $this->cli->main(['vobject', 'convert', '--format=mimedir', '--inputformat=json', '--pretty', '-']) ); @@ -266,7 +266,7 @@ public function testConvertMimeDir(): void VCF; - $this->assertEquals( + self::assertEquals( strtr($expected, ["\n" => "\r\n"]), stream_get_contents($this->cli->stdout) ); @@ -276,26 +276,26 @@ public function testConvertDefaultFormats(): void { $outputFile = $this->sabreTempDir.'bar.json'; - $this->assertEquals( + self::assertEquals( 2, $this->cli->main(['vobject', 'convert', 'foo.json', $outputFile]) ); - $this->assertEquals('json', $this->cli->inputFormat); - $this->assertEquals('json', $this->cli->format); + self::assertEquals('json', $this->cli->inputFormat); + self::assertEquals('json', $this->cli->format); } public function testConvertDefaultFormats2(): void { $outputFile = $this->sabreTempDir.'bar.ics'; - $this->assertEquals( + self::assertEquals( 2, $this->cli->main(['vobject', 'convert', 'foo.ics', $outputFile]) ); - $this->assertEquals('mimedir', $this->cli->inputFormat); - $this->assertEquals('mimedir', $this->cli->format); + self::assertEquals('mimedir', $this->cli->inputFormat); + self::assertEquals('mimedir', $this->cli->format); } public function testVCard3040(): void @@ -314,7 +314,7 @@ public function testVCard3040(): void rewind($inputStream); $this->cli->stdin = $inputStream; - $this->assertEquals( + self::assertEquals( 0, $this->cli->main(['vobject', 'convert', '--format=vcard40', '--pretty', '-']) ); @@ -331,7 +331,7 @@ public function testVCard3040(): void VCF; - $this->assertEquals( + self::assertEquals( strtr($expected, ["\n" => "\r\n"]), stream_get_contents($this->cli->stdout) ); @@ -353,7 +353,7 @@ public function testVCard4030(): void rewind($inputStream); $this->cli->stdin = $inputStream; - $this->assertEquals( + self::assertEquals( 0, $this->cli->main(['vobject', 'convert', '--format=vcard30', '--pretty', '-']) ); @@ -370,7 +370,7 @@ public function testVCard4030(): void VCF; - $this->assertEquals( + self::assertEquals( strtr($expected, ["\n" => "\r\n"]), stream_get_contents($this->cli->stdout) ); @@ -392,7 +392,7 @@ public function testVCard4021(): void rewind($inputStream); $this->cli->stdin = $inputStream; - $this->assertEquals( + self::assertEquals( 2, $this->cli->main(['vobject', 'convert', '--format=vcard21', '--pretty', '-']) ); @@ -416,7 +416,7 @@ public function testValidate(): void $this->cli->stdin = $inputStream; $result = $this->cli->main(['vobject', 'validate', '-']); - $this->assertEquals( + self::assertEquals( 0, $result ); @@ -436,7 +436,7 @@ public function testValidateFail(): void rewind($inputStream); $this->cli->stdin = $inputStream; // vCard 2.0 is not supported yet, so this returns a failure. - $this->assertEquals( + self::assertEquals( 2, $this->cli->main(['vobject', 'validate', '-']) ); @@ -456,7 +456,7 @@ public function testValidateFail2(): void rewind($inputStream); $this->cli->stdin = $inputStream; - $this->assertEquals( + self::assertEquals( 2, $this->cli->main(['vobject', 'validate', '-']) ); @@ -476,7 +476,7 @@ public function testRepair(): void rewind($inputStream); $this->cli->stdin = $inputStream; - $this->assertEquals( + self::assertEquals( 2, $this->cli->main(['vobject', 'repair', '-']) ); @@ -484,7 +484,7 @@ public function testRepair(): void rewind($this->cli->stdout); $regularExpression = "/^BEGIN:VCARD\r\nVERSION:2.1\r\nUID:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\r\nEND:VCARD\r\n$/"; $data = stream_get_contents($this->cli->stdout); - $this->assertMatchesRegularExpression($regularExpression, $data); + self::assertMatchesRegularExpression($regularExpression, $data); } public function testRepairNothing(): void @@ -512,7 +512,7 @@ public function testRepairNothing(): void rewind($this->cli->stderr); $error = stream_get_contents($this->cli->stderr); - $this->assertEquals( + self::assertEquals( 0, $result, "This should have been error free. stderr output:\n".$error @@ -558,7 +558,7 @@ public function testColorCalendar(): void rewind($this->cli->stderr); $error = stream_get_contents($this->cli->stderr); - $this->assertEquals( + self::assertEquals( 0, $result, "This should have been error free. stderr output:\n".$error @@ -599,7 +599,7 @@ public function testColorVCard(): void rewind($this->cli->stderr); $error = stream_get_contents($this->cli->stderr); - $this->assertEquals( + self::assertEquals( 0, $result, "This should have been error free. stderr output:\n".$error diff --git a/tests/VObject/Component/AvailableTest.php b/tests/VObject/Component/AvailableTest.php index ce3f6ed6..98202ffc 100644 --- a/tests/VObject/Component/AvailableTest.php +++ b/tests/VObject/Component/AvailableTest.php @@ -20,7 +20,7 @@ public function testAvailableComponent(): void END:VCALENDAR VCAL; $document = Reader::read($vcal); - $this->assertInstanceOf(Available::class, $document->AVAILABLE); + self::assertInstanceOf(Available::class, $document->AVAILABLE); } public function testGetEffectiveStartEnd(): void @@ -36,7 +36,7 @@ public function testGetEffectiveStartEnd(): void $document = Reader::read($vcal); $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2015-07-17 16:22:00', $tz), new \DateTimeImmutable('2015-07-17 17:22:00', $tz), @@ -58,7 +58,7 @@ public function testGetEffectiveStartEndDuration(): void $document = Reader::read($vcal); $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2015-07-17 16:22:00', $tz), new \DateTimeImmutable('2015-07-17 17:22:00', $tz), diff --git a/tests/VObject/Component/VAlarmTest.php b/tests/VObject/Component/VAlarmTest.php index d59fa6cc..4694d636 100644 --- a/tests/VObject/Component/VAlarmTest.php +++ b/tests/VObject/Component/VAlarmTest.php @@ -13,7 +13,7 @@ class VAlarmTest extends TestCase */ public function testInTimeRange(VAlarm $valarm, \DateTime $start, \DateTime $end, bool $outcome): void { - $this->assertEquals($outcome, $valarm->isInTimeRange($start, $end)); + self::assertEquals($outcome, $valarm->isInTimeRange($start, $end)); } public function timeRangeTestData(): array @@ -165,6 +165,6 @@ public function testInTimeRangeBuggy(): void $vobj = Reader::read($input); - $this->assertTrue($vobj->VTODO->VALARM->isInTimeRange(new \DateTime('2012-10-01 00:00:00'), new \DateTime('2012-11-01 00:00:00'))); + self::assertTrue($vobj->VTODO->VALARM->isInTimeRange(new \DateTime('2012-10-01 00:00:00'), new \DateTime('2012-11-01 00:00:00'))); } } diff --git a/tests/VObject/Component/VAvailabilityTest.php b/tests/VObject/Component/VAvailabilityTest.php index 30ec3d56..263eeebd 100644 --- a/tests/VObject/Component/VAvailabilityTest.php +++ b/tests/VObject/Component/VAvailabilityTest.php @@ -22,7 +22,7 @@ public function testVAvailabilityComponent(): void VCAL; $document = Reader::read($vcal); - $this->assertInstanceOf(VAvailability::class, $document->VAVAILABILITY); + self::assertInstanceOf(VAvailability::class, $document->VAVAILABILITY); } public function testGetEffectiveStartEnd(): void @@ -38,7 +38,7 @@ public function testGetEffectiveStartEnd(): void $document = Reader::read($vcal); $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2015-07-17 16:22:00', $tz), new \DateTimeImmutable('2015-07-17 17:22:00', $tz), @@ -60,7 +60,7 @@ public function testGetEffectiveStartDuration(): void $document = Reader::read($vcal); $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2015-07-17 16:22:00', $tz), new \DateTimeImmutable('2015-07-17 17:22:00', $tz), @@ -79,7 +79,7 @@ public function testGetEffectiveStartEndUnbound(): void VCAL; $document = Reader::read($vcal); - $this->assertEquals( + self::assertEquals( [ null, null, @@ -98,7 +98,7 @@ public function testIsInTimeRangeUnbound(): void VCAL; $document = Reader::read($vcal); - $this->assertTrue( + self::assertTrue( $document->VAVAILABILITY->isInTimeRange(new \DateTimeImmutable('2015-07-17'), new \DateTimeImmutable('2015-07-18')) ); } @@ -115,7 +115,7 @@ public function testIsInTimeRangeOutside(): void VCAL; $document = Reader::read($vcal); - $this->assertFalse( + self::assertFalse( $document->VAVAILABILITY->isInTimeRange(new \DateTimeImmutable('2015-07-17'), new \DateTimeImmutable('2015-07-18')) ); } @@ -123,7 +123,7 @@ public function testIsInTimeRangeOutside(): void public function testRFCxxxSection3Part1AvailabilityPropRequired(): void { // UID and DTSTAMP are present. - $this->assertIsValid(Reader::read( + self::assertIsValid(Reader::read( <<assertIsNotValid(Reader::read( + self::assertIsNotValid(Reader::read( <<assertIsNotValid(Reader::read( + self::assertIsNotValid(Reader::read( <<assertIsNotValid(Reader::read( + self::assertIsNotValid(Reader::read( <<assertIsValid(Reader::read($this->template($properties))); + self::assertIsValid(Reader::read($this->template($properties))); // We duplicate each one to see if it fails. foreach ($properties as $property) { - $this->assertIsNotValid(Reader::read($this->template([ + self::assertIsNotValid(Reader::read($this->template([ $property, $property, ]))); @@ -206,17 +206,17 @@ public function testRFCxxxSection3Part1AvailabilityPropOptionalOnce(): void public function testRFCxxxSection3Part1AvailabilityPropDtendDuration(): void { // Only DTEND. - $this->assertIsValid(Reader::read($this->template([ + self::assertIsValid(Reader::read($this->template([ 'DTEND:21111005T133225Z', ]))); // Only DURATION. - $this->assertIsValid(Reader::read($this->template([ + self::assertIsValid(Reader::read($this->template([ 'DURATION:PT1H', ]))); // Both (not allowed). - $this->assertIsNotValid(Reader::read($this->template([ + self::assertIsNotValid(Reader::read($this->template([ 'DTEND:21111005T133225Z', 'DURATION:PT1H', ]))); @@ -234,13 +234,13 @@ public function testAvailableSubComponent(): void VCAL; $document = Reader::read($vcal); - $this->assertInstanceOf(Available::class, $document->VAVAILABILITY->AVAILABLE); + self::assertInstanceOf(Available::class, $document->VAVAILABILITY->AVAILABLE); } public function testRFCxxxSection3Part1AvailablePropRequired(): void { // UID, DTSTAMP and DTSTART are present. - $this->assertIsValid(Reader::read( + self::assertIsValid(Reader::read( <<assertIsNotValid(Reader::read( + self::assertIsNotValid(Reader::read( <<assertIsNotValid(Reader::read( + self::assertIsNotValid(Reader::read( <<assertIsNotValid(Reader::read( + self::assertIsNotValid(Reader::read( <<assertIsNotValid(Reader::read( + self::assertIsNotValid(Reader::read( <<assertIsValid(Reader::read($this->templateAvailable([ + self::assertIsValid(Reader::read($this->templateAvailable([ 'DTEND:21111005T133225Z', ]))); // Only DURATION. - $this->assertIsValid(Reader::read($this->templateAvailable([ + self::assertIsValid(Reader::read($this->templateAvailable([ 'DURATION:PT1H', ]))); // Both (not allowed). - $this->assertIsNotValid(Reader::read($this->templateAvailable([ + self::assertIsNotValid(Reader::read($this->templateAvailable([ 'DTEND:21111005T133225Z', 'DURATION:PT1H', ]))); @@ -360,11 +360,11 @@ public function testRFCxxxSection3Part1AvailableOptionalOnce(): void ]; // They are all present, only once. - $this->assertIsValid(Reader::read($this->templateAvailable($properties))); + self::assertIsValid(Reader::read($this->templateAvailable($properties))); // We duplicate each one to see if it fails. foreach ($properties as $property) { - $this->assertIsNotValid(Reader::read($this->templateAvailable([ + self::assertIsNotValid(Reader::read($this->templateAvailable([ $property, $property, ]))); @@ -373,7 +373,7 @@ public function testRFCxxxSection3Part1AvailableOptionalOnce(): void public function testRFCxxxSection3Part2(): void { - $this->assertEquals( + self::assertEquals( 'BUSY', Reader::read($this->templateAvailable([ 'BUSYTYPE:BUSY', @@ -384,7 +384,7 @@ public function testRFCxxxSection3Part2(): void ->getValue() ); - $this->assertEquals( + self::assertEquals( 'BUSY-UNAVAILABLE', Reader::read($this->templateAvailable([ 'BUSYTYPE:BUSY-UNAVAILABLE', @@ -395,7 +395,7 @@ public function testRFCxxxSection3Part2(): void ->getValue() ); - $this->assertEquals( + self::assertEquals( 'BUSY-TENTATIVE', Reader::read($this->templateAvailable([ 'BUSYTYPE:BUSY-TENTATIVE', @@ -414,12 +414,12 @@ protected function assertIsValid(VObject\Document $document): void $messages = array_map(function ($item) { return $item['message']; }, $validationResult); $this->fail('Failed to assert that the supplied document is a valid document. Validation messages: '.implode(', ', $messages)); } - $this->assertEmpty($document->validate()); + self::assertEmpty($document->validate()); } protected function assertIsNotValid(VObject\Document $document): void { - $this->assertNotEmpty($document->validate()); + self::assertNotEmpty($document->validate()); } protected function template(array $properties) diff --git a/tests/VObject/Component/VCalendarTest.php b/tests/VObject/Component/VCalendarTest.php index d1a2e540..bde6a4fa 100644 --- a/tests/VObject/Component/VCalendarTest.php +++ b/tests/VObject/Component/VCalendarTest.php @@ -28,7 +28,7 @@ public function testExpand(string $input, string $output, string $timeZone = 'UT // This will normalize the output $output = VObject\Reader::read($output)->serialize(); - $this->assertVObjectEqualsVObject($output, $vcal->serialize()); + self::assertVObjectEqualsVObject($output, $vcal->serialize()); } public function expandData(): array @@ -373,14 +373,14 @@ public function testEventExpandYearly(): void new \DateTime('2023-01-01') ); - $this->assertCount(7, $events->VEVENT); + self::assertCount(7, $events->VEVENT); } public function testGetDocumentType(): void { $vcard = new VCalendar(); $vcard->VERSION = '2.0'; - $this->assertEquals(VCalendar::ICALENDAR20, $vcard->getDocumentType()); + self::assertEquals(VCalendar::ICALENDAR20, $vcard->getDocumentType()); } public function testValidateCorrect(): void @@ -398,7 +398,7 @@ public function testValidateCorrect(): void '; $vcal = VObject\Reader::read($input); - $this->assertEquals([], $vcal->validate(), 'Got an error'); + self::assertEquals([], $vcal->validate(), 'Got an error'); } public function testValidateNoVersion(): void @@ -415,7 +415,7 @@ public function testValidateNoVersion(): void '; $vcal = VObject\Reader::read($input); - $this->assertCount(1, $vcal->validate()); + self::assertCount(1, $vcal->validate()); } public function testValidateWrongVersion(): void @@ -433,7 +433,7 @@ public function testValidateWrongVersion(): void '; $vcal = VObject\Reader::read($input); - $this->assertCount(1, $vcal->validate()); + self::assertCount(1, $vcal->validate()); } public function testValidateNoProdId(): void @@ -450,7 +450,7 @@ public function testValidateNoProdId(): void '; $vcal = VObject\Reader::read($input); - $this->assertCount(1, $vcal->validate()); + self::assertCount(1, $vcal->validate()); } public function testValidateDoubleCalScale(): void @@ -469,7 +469,7 @@ public function testValidateDoubleCalScale(): void '; $vcal = VObject\Reader::read($input); - $this->assertCount(1, $vcal->validate()); + self::assertCount(1, $vcal->validate()); } public function testValidateDoubleMethod(): void @@ -488,7 +488,7 @@ public function testValidateDoubleMethod(): void '; $vcal = VObject\Reader::read($input); - $this->assertCount(1, $vcal->validate()); + self::assertCount(1, $vcal->validate()); } public function testValidateTwoMasterEvents(): void @@ -511,7 +511,7 @@ public function testValidateTwoMasterEvents(): void '; $vcal = VObject\Reader::read($input); - $this->assertCount(1, $vcal->validate()); + self::assertCount(1, $vcal->validate()); } public function testValidateOneMasterEvent(): void @@ -535,7 +535,7 @@ public function testValidateOneMasterEvent(): void '; $vcal = VObject\Reader::read($input); - $this->assertCount(0, $vcal->validate()); + self::assertCount(0, $vcal->validate()); } public function testGetBaseComponent(): void @@ -562,7 +562,7 @@ public function testGetBaseComponent(): void $vcal = VObject\Reader::read($input); $result = $vcal->getBaseComponent(); - $this->assertEquals('test', $result->SUMMARY->getValue()); + self::assertEquals('test', $result->SUMMARY->getValue()); } public function testGetBaseComponentNoResult(): void @@ -590,7 +590,7 @@ public function testGetBaseComponentNoResult(): void $vcal = VObject\Reader::read($input); $result = $vcal->getBaseComponent(); - $this->assertNull($result); + self::assertNull($result); } public function testGetBaseComponentWithFilter(): void @@ -617,7 +617,7 @@ public function testGetBaseComponentWithFilter(): void $vcal = VObject\Reader::read($input); $result = $vcal->getBaseComponent('VEVENT'); - $this->assertEquals('test', $result->SUMMARY->getValue()); + self::assertEquals('test', $result->SUMMARY->getValue()); } public function testGetBaseComponentWithFilterNoResult(): void @@ -637,7 +637,7 @@ public function testGetBaseComponentWithFilterNoResult(): void $vcal = VObject\Reader::read($input); $result = $vcal->getBaseComponent('VEVENT'); - $this->assertNull($result); + self::assertNull($result); } public function testNoComponents(): void @@ -649,7 +649,7 @@ public function testNoComponents(): void END:VCALENDAR ICS; - $this->assertValidate( + self::assertValidate( $input, 0, 3, @@ -669,7 +669,7 @@ public function testCalDAVNoComponents(): void END:VCALENDAR ICS; - $this->assertValidate( + self::assertValidate( $input, VCalendar::PROFILE_CALDAV, 3, @@ -696,7 +696,7 @@ public function testCalDAVMultiUID(): void END:VCALENDAR ICS; - $this->assertValidate( + self::assertValidate( $input, VCalendar::PROFILE_CALDAV, 3, @@ -724,7 +724,7 @@ public function testCalDAVMultiComponent(): void END:VCALENDAR ICS; - $this->assertValidate( + self::assertValidate( $input, VCalendar::PROFILE_CALDAV, 3, @@ -748,7 +748,7 @@ public function testCalDAVMETHOD(): void END:VCALENDAR ICS; - $this->assertValidate( + self::assertValidate( $input, VCalendar::PROFILE_CALDAV, 3, @@ -761,7 +761,7 @@ public function assertValidate($ics, $options, $expectedLevel, ?string $expected $vcal = VObject\Reader::read($ics); $result = $vcal->validate($options); - $this->assertValidateResult($result, $expectedLevel, $expectedMessage); + self::assertValidateResult($result, $expectedLevel, $expectedMessage); } public function assertValidateResult($input, $expectedLevel, ?string $expectedMessage = null): void @@ -772,12 +772,12 @@ public function assertValidateResult($input, $expectedLevel, ?string $expectedMe } if (0 === $expectedLevel) { - $this->assertCount(0, $input, 'No validation messages were expected. We got: '.implode(', ', $messages)); + self::assertCount(0, $input, 'No validation messages were expected. We got: '.implode(', ', $messages)); } else { - $this->assertCount(1, $input, 'We expected exactly 1 validation message, We got: '.implode(', ', $messages)); + self::assertCount(1, $input, 'We expected exactly 1 validation message, We got: '.implode(', ', $messages)); - $this->assertEquals($expectedMessage, $input[0]['message']); - $this->assertEquals($expectedLevel, $input[0]['level']); + self::assertEquals($expectedMessage, $input[0]['message']); + self::assertEquals($expectedLevel, $input[0]['level']); } } } diff --git a/tests/VObject/Component/VCardTest.php b/tests/VObject/Component/VCardTest.php index da15de1c..3851d97d 100644 --- a/tests/VObject/Component/VCardTest.php +++ b/tests/VObject/Component/VCardTest.php @@ -21,11 +21,11 @@ public function testValidate(string $input, array $expectedWarnings, string $exp $warnMsg[] = $warning['message']; } - $this->assertEquals($expectedWarnings, $warnMsg); + self::assertEquals($expectedWarnings, $warnMsg); $vcard->validate(VObject\Component::REPAIR); - $this->assertEquals( + self::assertEquals( $expectedRepairedOutput, $vcard->serialize() ); @@ -116,18 +116,18 @@ public function testGetDocumentType(): void { $vcard = new VCard([], false); $vcard->VERSION = '2.1'; - $this->assertEquals(VCard::VCARD21, $vcard->getDocumentType()); + self::assertEquals(VCard::VCARD21, $vcard->getDocumentType()); $vcard = new VCard([], false); $vcard->VERSION = '3.0'; - $this->assertEquals(VCard::VCARD30, $vcard->getDocumentType()); + self::assertEquals(VCard::VCARD30, $vcard->getDocumentType()); $vcard = new VCard([], false); $vcard->VERSION = '4.0'; - $this->assertEquals(VCard::VCARD40, $vcard->getDocumentType()); + self::assertEquals(VCard::VCARD40, $vcard->getDocumentType()); $vcard = new VCard([], false); - $this->assertEquals(VCard::UNKNOWN, $vcard->getDocumentType()); + self::assertEquals(VCard::UNKNOWN, $vcard->getDocumentType()); } public function testGetByType(): void @@ -141,10 +141,10 @@ public function testGetByType(): void VCF; $vcard = VObject\Reader::read($vcard); - $this->assertEquals('1@example.org', $vcard->getByType('EMAIL', 'home')->getValue()); - $this->assertEquals('2@example.org', $vcard->getByType('EMAIL', 'work')->getValue()); - $this->assertNull($vcard->getByType('EMAIL', 'non-existent')); - $this->assertNull($vcard->getByType('ADR', 'non-existent')); + self::assertEquals('1@example.org', $vcard->getByType('EMAIL', 'home')->getValue()); + self::assertEquals('2@example.org', $vcard->getByType('EMAIL', 'work')->getValue()); + self::assertNull($vcard->getByType('EMAIL', 'non-existent')); + self::assertNull($vcard->getByType('ADR', 'non-existent')); } public function testPreferredNoPref(): void @@ -158,7 +158,7 @@ public function testPreferredNoPref(): void VCF; $vcard = VObject\Reader::read($vcard); - $this->assertEquals('1@example.org', $vcard->preferred('EMAIL')->getValue()); + self::assertEquals('1@example.org', $vcard->preferred('EMAIL')->getValue()); } public function testPreferredWithPref(): void @@ -172,7 +172,7 @@ public function testPreferredWithPref(): void VCF; $vcard = VObject\Reader::read($vcard); - $this->assertEquals('2@example.org', $vcard->preferred('EMAIL')->getValue()); + self::assertEquals('2@example.org', $vcard->preferred('EMAIL')->getValue()); } public function testPreferredWith40Pref(): void @@ -187,7 +187,7 @@ public function testPreferredWith40Pref(): void VCF; $vcard = VObject\Reader::read($vcard); - $this->assertEquals('3@example.org', $vcard->preferred('EMAIL')->getValue()); + self::assertEquals('3@example.org', $vcard->preferred('EMAIL')->getValue()); } public function testPreferredNotFound(): void @@ -199,7 +199,7 @@ public function testPreferredNotFound(): void VCF; $vcard = VObject\Reader::read($vcard); - $this->assertNull($vcard->preferred('EMAIL')); + self::assertNull($vcard->preferred('EMAIL')); } public function testNoUIDCardDAV(): void @@ -210,7 +210,7 @@ public function testNoUIDCardDAV(): void FN:John Doe END:VCARD VCF; - $this->assertValidate( + self::assertValidate( $vcard, VCard::PROFILE_CARDDAV, 3, @@ -226,7 +226,7 @@ public function testNoUIDNoCardDAV(): void FN:John Doe END:VCARD VCF; - $this->assertValidate( + self::assertValidate( $vcard, 0, 2, @@ -242,7 +242,7 @@ public function testNoUIDNoCardDAVRepair(): void FN:John Doe END:VCARD VCF; - $this->assertValidate( + self::assertValidate( $vcard, VCard::REPAIR, 1, @@ -259,7 +259,7 @@ public function testVCard21CardDAV(): void UID:foo END:VCARD VCF; - $this->assertValidate( + self::assertValidate( $vcard, VCard::PROFILE_CARDDAV, 3, @@ -276,7 +276,7 @@ public function testVCard21NoCardDAV(): void UID:foo END:VCARD VCF; - $this->assertValidate( + self::assertValidate( $vcard, 0, 0 @@ -288,7 +288,7 @@ public function assertValidate($vcf, $options, int $expectedLevel, ?string $expe $vcal = VObject\Reader::read($vcf); $result = $vcal->validate($options); - $this->assertValidateResult($result, $expectedLevel, $expectedMessage); + self::assertValidateResult($result, $expectedLevel, $expectedMessage); } public function assertValidateResult($input, int $expectedLevel, ?string $expectedMessage = null): void @@ -299,12 +299,12 @@ public function assertValidateResult($input, int $expectedLevel, ?string $expect } if (0 === $expectedLevel) { - $this->assertCount(0, $input, 'No validation messages were expected. We got: '.implode(', ', $messages)); + self::assertCount(0, $input, 'No validation messages were expected. We got: '.implode(', ', $messages)); } else { - $this->assertCount(1, $input, 'We expected exactly 1 validation message, We got: '.implode(', ', $messages)); + self::assertCount(1, $input, 'We expected exactly 1 validation message, We got: '.implode(', ', $messages)); - $this->assertEquals($expectedMessage, $input[0]['message']); - $this->assertEquals($expectedLevel, $input[0]['level']); + self::assertEquals($expectedMessage, $input[0]['message']); + self::assertEquals($expectedLevel, $input[0]['level']); } } } diff --git a/tests/VObject/Component/VEventTest.php b/tests/VObject/Component/VEventTest.php index 8d73ac11..50fa626c 100644 --- a/tests/VObject/Component/VEventTest.php +++ b/tests/VObject/Component/VEventTest.php @@ -11,7 +11,7 @@ class VEventTest extends TestCase */ public function testInTimeRange(VEvent $vevent, \DateTime $start, \DateTime $end, bool $outcome): void { - $this->assertEquals($outcome, $vevent->isInTimeRange($start, $end)); + self::assertEquals($outcome, $vevent->isInTimeRange($start, $end)); } public function timeRangeTestData(): array diff --git a/tests/VObject/Component/VFreeBusyTest.php b/tests/VObject/Component/VFreeBusyTest.php index c1e22dd1..f3a521f9 100644 --- a/tests/VObject/Component/VFreeBusyTest.php +++ b/tests/VObject/Component/VFreeBusyTest.php @@ -28,14 +28,14 @@ public function testIsFree(): void $tz = new \DateTimeZone('UTC'); - $this->assertFalse($vfb->isFree(new \DateTime('2012-09-12 01:15:00', $tz), new \DateTime('2012-09-12 01:45:00', $tz))); - $this->assertFalse($vfb->isFree(new \DateTime('2012-09-12 08:05:00', $tz), new \DateTime('2012-09-12 08:10:00', $tz))); - $this->assertFalse($vfb->isFree(new \DateTime('2012-09-12 10:15:00', $tz), new \DateTime('2012-09-12 10:45:00', $tz))); + self::assertFalse($vfb->isFree(new \DateTime('2012-09-12 01:15:00', $tz), new \DateTime('2012-09-12 01:45:00', $tz))); + self::assertFalse($vfb->isFree(new \DateTime('2012-09-12 08:05:00', $tz), new \DateTime('2012-09-12 08:10:00', $tz))); + self::assertFalse($vfb->isFree(new \DateTime('2012-09-12 10:15:00', $tz), new \DateTime('2012-09-12 10:45:00', $tz))); // Checking whether the end time is treated as non-inclusive - $this->assertTrue($vfb->isFree(new \DateTime('2012-09-12 09:00:00', $tz), new \DateTime('2012-09-12 09:15:00', $tz))); - $this->assertTrue($vfb->isFree(new \DateTime('2012-09-12 09:45:00', $tz), new \DateTime('2012-09-12 10:00:00', $tz))); - $this->assertTrue($vfb->isFree(new \DateTime('2012-09-12 11:00:00', $tz), new \DateTime('2012-09-12 12:00:00', $tz))); + self::assertTrue($vfb->isFree(new \DateTime('2012-09-12 09:00:00', $tz), new \DateTime('2012-09-12 09:15:00', $tz))); + self::assertTrue($vfb->isFree(new \DateTime('2012-09-12 09:45:00', $tz), new \DateTime('2012-09-12 10:00:00', $tz))); + self::assertTrue($vfb->isFree(new \DateTime('2012-09-12 11:00:00', $tz), new \DateTime('2012-09-12 12:00:00', $tz))); } public function testValidate(): void @@ -59,6 +59,6 @@ public function testValidate(): void $messages[] = $warning['message']; } - $this->assertEquals([], $messages); + self::assertEquals([], $messages); } } diff --git a/tests/VObject/Component/VJournalTest.php b/tests/VObject/Component/VJournalTest.php index 012c9a31..98f47889 100644 --- a/tests/VObject/Component/VJournalTest.php +++ b/tests/VObject/Component/VJournalTest.php @@ -12,7 +12,7 @@ class VJournalTest extends TestCase */ public function testInTimeRange(VJournal $vtodo, \DateTime $start, \DateTime $end, bool $outcome): void { - $this->assertEquals($outcome, $vtodo->isInTimeRange($start, $end)); + self::assertEquals($outcome, $vtodo->isInTimeRange($start, $end)); } public function testValidate(): void @@ -36,7 +36,7 @@ public function testValidate(): void $messages[] = $warning['message']; } - $this->assertEquals([], $messages); + self::assertEquals([], $messages); } public function testValidateBroken(): void @@ -62,7 +62,7 @@ public function testValidateBroken(): void $messages[] = $warning['message']; } - $this->assertEquals( + self::assertEquals( ['URL MUST NOT appear more than once in a VJOURNAL component'], $messages ); diff --git a/tests/VObject/Component/VTimeZoneTest.php b/tests/VObject/Component/VTimeZoneTest.php index 9b8ab99e..2928ecd0 100644 --- a/tests/VObject/Component/VTimeZoneTest.php +++ b/tests/VObject/Component/VTimeZoneTest.php @@ -27,7 +27,7 @@ public function testValidate(): void $messages[] = $warning['message']; } - $this->assertEquals([], $messages); + self::assertEquals([], $messages); } public function testGetTimeZone(): void @@ -46,7 +46,7 @@ public function testGetTimeZone(): void $tz = new \DateTimeZone('America/Toronto'); - $this->assertEquals( + self::assertEquals( $tz, $obj->VTIMEZONE->getTimeZone() ); diff --git a/tests/VObject/Component/VTodoTest.php b/tests/VObject/Component/VTodoTest.php index ae0050aa..808675b3 100644 --- a/tests/VObject/Component/VTodoTest.php +++ b/tests/VObject/Component/VTodoTest.php @@ -12,7 +12,7 @@ class VTodoTest extends TestCase */ public function testInTimeRange(VTodo $vtodo, \DateTime $start, \DateTime $end, bool $outcome): void { - $this->assertEquals($outcome, $vtodo->isInTimeRange($start, $end)); + self::assertEquals($outcome, $vtodo->isInTimeRange($start, $end)); } public function timeRangeTestData(): array @@ -85,7 +85,7 @@ public function testValidate(): void $messages[] = $warning['message']; } - $this->assertEquals([], $messages); + self::assertEquals([], $messages); } public function testValidateInvalid(): void @@ -107,7 +107,7 @@ public function testValidateInvalid(): void $messages[] = $warning['message']; } - $this->assertEquals([ + self::assertEquals([ 'UID MUST appear exactly once in a VTODO component', 'DTSTAMP MUST appear exactly once in a VTODO component', ], $messages); @@ -136,7 +136,7 @@ public function testValidateDueDateTimeStartMisMatch(): void $messages[] = $warning['message']; } - $this->assertEquals([ + self::assertEquals([ 'The value type (DATE or DATE-TIME) must be identical for DUE and DTSTART', ], $messages); } @@ -164,7 +164,7 @@ public function testValidateDueBeforeDateTimeStart(): void $messages[] = $warning['message']; } - $this->assertEquals([ + self::assertEquals([ 'DUE must occur after DTSTART', ], $messages); } diff --git a/tests/VObject/ComponentTest.php b/tests/VObject/ComponentTest.php index 9bb680b7..4a247d90 100644 --- a/tests/VObject/ComponentTest.php +++ b/tests/VObject/ComponentTest.php @@ -21,13 +21,13 @@ public function testIterate(): void $count = 0; foreach ($comp->children() as $key => $subcomponent) { ++$count; - $this->assertInstanceOf(Component::class, $subcomponent); + self::assertInstanceOf(Component::class, $subcomponent); if (2 === $count) { - $this->assertEquals(1, $key); + self::assertEquals(1, $key); } } - $this->assertEquals(2, $count); + self::assertEquals(2, $count); } public function testMagicGet(): void @@ -41,10 +41,10 @@ public function testMagicGet(): void $comp->add($sub); $event = $comp->VEVENT; - $this->assertInstanceOf(Component::class, $event); - $this->assertEquals('VEVENT', $event->name); + self::assertInstanceOf(Component::class, $event); + self::assertEquals('VEVENT', $event->name); - $this->assertNull($comp->VJOURNAL); + self::assertNull($comp->VJOURNAL); } /** @@ -67,26 +67,26 @@ public function testMagicGetGroups(): void $comp->add($sub); $emails = $comp->EMAIL; - $this->assertCount(4, $emails); + self::assertCount(4, $emails); $email1 = $comp->{'group1.email'}; - $this->assertEquals('EMAIL', $email1[0]->name); - $this->assertEquals('GROUP1', $email1[0]->group); + self::assertEquals('EMAIL', $email1[0]->name); + self::assertEquals('GROUP1', $email1[0]->group); $email0 = $comp->{'0.email'}; - $this->assertEquals('EMAIL', $email0[0]->name); - $this->assertEquals('0', $email0[0]->group); + self::assertEquals('EMAIL', $email0[0]->name); + self::assertEquals('0', $email0[0]->group); // this is supposed to return all EMAIL properties that do not have a group $email3 = $comp->{'.email'}; - $this->assertEquals('EMAIL', $email3[0]->name); - $this->assertEquals(null, $email3[0]->group); + self::assertEquals('EMAIL', $email3[0]->name); + self::assertEquals(null, $email3[0]->group); // this is supposed to return all properties that do not have a group $nogroupProps = $comp->{'.'}; - $this->assertGreaterThan(0, count($email3)); + self::assertGreaterThan(0, count($email3)); foreach ($nogroupProps as $prop) { - $this->assertEquals(null, $prop->group); + self::assertEquals(null, $prop->group); } } @@ -101,9 +101,9 @@ public function testAddGroupProperties(): void foreach (['item2', 'ITEM1'] as $group) { $prop = $comp->{"$group.X-ABLabel"}; - $this->assertInstanceOf(Property::class, $prop); - $this->assertSame("$group-Foo", (string) $prop); - $this->assertSame($group, $prop->group); + self::assertInstanceOf(Property::class, $prop); + self::assertSame("$group-Foo", (string) $prop); + self::assertSame($group, $prop->group); } } @@ -117,9 +117,9 @@ public function testMagicIsset(): void $sub = $comp->createComponent('VTODO'); $comp->add($sub); - $this->assertTrue(isset($comp->vevent)); - $this->assertTrue(isset($comp->vtodo)); - $this->assertFalse(isset($comp->vjournal)); + self::assertTrue(isset($comp->vevent)); + self::assertTrue(isset($comp->vtodo)); + self::assertFalse(isset($comp->vjournal)); } public function testMagicSetScalar(): void @@ -127,8 +127,8 @@ public function testMagicSetScalar(): void $comp = new VCalendar(); $comp->myProp = 'myValue'; - $this->assertInstanceOf(Property::class, $comp->MYPROP); - $this->assertEquals('myValue', (string) $comp->MYPROP); + self::assertInstanceOf(Property::class, $comp->MYPROP); + self::assertEquals('myValue', (string) $comp->MYPROP); } public function testMagicSetScalarTwice(): void @@ -137,9 +137,9 @@ public function testMagicSetScalarTwice(): void $comp->myProp = 'myValue'; $comp->myProp = 'myValue'; - $this->assertCount(1, $comp->children()); - $this->assertInstanceOf(Property::class, $comp->MYPROP); - $this->assertEquals('myValue', (string) $comp->MYPROP); + self::assertCount(1, $comp->children()); + self::assertInstanceOf(Property::class, $comp->MYPROP); + self::assertEquals('myValue', (string) $comp->MYPROP); } public function testMagicSetArray(): void @@ -147,8 +147,8 @@ public function testMagicSetArray(): void $comp = new VCalendar(); $comp->ORG = ['Acme Inc', 'Section 9']; - $this->assertInstanceOf(Property::class, $comp->ORG); - $this->assertEquals(['Acme Inc', 'Section 9'], $comp->ORG->getParts()); + self::assertInstanceOf(Property::class, $comp->ORG); + self::assertEquals(['Acme Inc', 'Section 9'], $comp->ORG->getParts()); } public function testMagicSetComponent(): void @@ -158,9 +158,9 @@ public function testMagicSetComponent(): void // Note that 'myProp' is ignored here. $comp->myProp = $comp->createComponent('VEVENT'); - $this->assertCount(1, $comp); + self::assertCount(1, $comp); - $this->assertEquals('VEVENT', $comp->VEVENT->name); + self::assertEquals('VEVENT', $comp->VEVENT->name); } public function testMagicSetTwice(): void @@ -170,9 +170,9 @@ public function testMagicSetTwice(): void $comp->VEVENT = $comp->createComponent('VEVENT'); $comp->VEVENT = $comp->createComponent('VEVENT'); - $this->assertCount(1, $comp->children()); + self::assertCount(1, $comp->children()); - $this->assertEquals('VEVENT', $comp->VEVENT->name); + self::assertEquals('VEVENT', $comp->VEVENT->name); } public function testArrayAccessGet(): void @@ -189,9 +189,9 @@ public function testArrayAccessGet(): void $comp->add($event2); - $this->assertCount(2, $comp->children()); - $this->assertTrue($comp->vevent[1] instanceof Component); - $this->assertEquals('Event 2', (string) $comp->vevent[1]->summary); + self::assertCount(2, $comp->children()); + self::assertTrue($comp->vevent[1] instanceof Component); + self::assertEquals('Event 2', (string) $comp->vevent[1]->summary); } public function testArrayAccessExists(): void @@ -208,8 +208,8 @@ public function testArrayAccessExists(): void $comp->add($event2); - $this->assertTrue(isset($comp->vevent[0])); - $this->assertTrue(isset($comp->vevent[1])); + self::assertTrue(isset($comp->vevent[0])); + self::assertTrue(isset($comp->vevent[1])); } public function testArrayAccessSet(): void @@ -232,13 +232,13 @@ public function testAddScalar(): void $comp->add('myprop', 'value'); - $this->assertCount(1, $comp->children()); + self::assertCount(1, $comp->children()); $bla = $comp->children()[0]; - $this->assertTrue($bla instanceof Property); - $this->assertEquals('MYPROP', $bla->name); - $this->assertEquals('value', (string) $bla); + self::assertTrue($bla instanceof Property); + self::assertEquals('MYPROP', $bla->name); + self::assertEquals('value', (string) $bla); } public function testAddScalarParams(): void @@ -247,18 +247,18 @@ public function testAddScalarParams(): void $comp->add('myprop', 'value', ['param1' => 'value1']); - $this->assertCount(1, $comp->children()); + self::assertCount(1, $comp->children()); $bla = $comp->children()[0]; - $this->assertInstanceOf(Property::class, $bla); - $this->assertEquals('MYPROP', $bla->name); - $this->assertEquals('value', (string) $bla); + self::assertInstanceOf(Property::class, $bla); + self::assertEquals('MYPROP', $bla->name); + self::assertEquals('value', (string) $bla); - $this->assertCount(1, $bla->parameters()); + self::assertCount(1, $bla->parameters()); - $this->assertEquals('PARAM1', $bla->parameters['PARAM1']->name); - $this->assertEquals('value1', $bla->parameters['PARAM1']->getValue()); + self::assertEquals('PARAM1', $bla->parameters['PARAM1']->name); + self::assertEquals('value1', $bla->parameters['PARAM1']->getValue()); } public function testAddComponent(): void @@ -267,9 +267,9 @@ public function testAddComponent(): void $comp->add($comp->createComponent('VEVENT')); - $this->assertCount(1, $comp->children()); + self::assertCount(1, $comp->children()); - $this->assertEquals('VEVENT', $comp->VEVENT->name); + self::assertEquals('VEVENT', $comp->VEVENT->name); } public function testAddComponentTwice(): void @@ -279,9 +279,9 @@ public function testAddComponentTwice(): void $comp->add($comp->createComponent('VEVENT')); $comp->add($comp->createComponent('VEVENT')); - $this->assertCount(2, $comp->children()); + self::assertCount(2, $comp->children()); - $this->assertEquals('VEVENT', $comp->VEVENT->name); + self::assertEquals('VEVENT', $comp->VEVENT->name); } public function testAddArgFail(): void @@ -305,13 +305,13 @@ public function testMagicUnset(): void unset($comp->vevent); - $this->assertCount(0, $comp->children()); + self::assertCount(0, $comp->children()); } public function testCount(): void { $comp = new VCalendar(); - $this->assertEquals(1, $comp->count()); + self::assertEquals(1, $comp->count()); } public function testChildren(): void @@ -323,8 +323,8 @@ public function testChildren(): void $comp->add($comp->createComponent('VTODO')); $r = $comp->children(); - $this->assertIsArray($r); - $this->assertCount(2, $r); + self::assertIsArray($r); + self::assertCount(2, $r); } /** @@ -338,15 +338,15 @@ public function testGetComponents(): void $comp->add($comp->createComponent('VTODO')); $r = $comp->getComponents(); - $this->assertIsArray($r); - $this->assertCount(1, $r); - $this->assertEquals('VTODO', $r[0]->name); + self::assertIsArray($r); + self::assertCount(1, $r); + self::assertEquals('VTODO', $r[0]->name); } public function testSerialize(): void { $comp = new VCalendar([], false); - $this->assertEquals("BEGIN:VCALENDAR\r\nEND:VCALENDAR\r\n", $comp->serialize()); + self::assertEquals("BEGIN:VCALENDAR\r\nEND:VCALENDAR\r\n", $comp->serialize()); } public function testSerializeChildren(): void @@ -359,7 +359,7 @@ public function testSerializeChildren(): void $str = $comp->serialize(); - $this->assertEquals("BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nEND:VEVENT\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n", $str); + self::assertEquals("BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nEND:VEVENT\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n", $str); } public function testSerializeOrderCompAndProp(): void @@ -373,7 +373,7 @@ public function testSerializeOrderCompAndProp(): void unset($event->DTSTAMP, $event->UID); $str = $comp->serialize(); - $this->assertEquals("BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPROP1:BLABLA\r\nBEGIN:VTIMEZONE\r\nEND:VTIMEZONE\r\nBEGIN:VEVENT\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n", $str); + self::assertEquals("BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPROP1:BLABLA\r\nBEGIN:VTIMEZONE\r\nEND:VTIMEZONE\r\nBEGIN:VEVENT\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n", $str); } public function testAnotherSerializeOrderProp(): void @@ -399,7 +399,7 @@ public function testAnotherSerializeOrderProp(): void $str = $comp->serialize(); - $this->assertEquals("BEGIN:VCARD\r\nVERSION:2.0\r\nSOMEPROP:FOO\r\nANOTHERPROP:FOO\r\nTHIRDPROP:FOO\r\nPROP4:FOO 1\r\nPROP4:FOO 2\r\nPROP4:FOO 3\r\nPROP4:FOO 4\r\nPROP4:FOO 5\r\nPROP4:FOO 6\r\nPROP4:FOO 7\r\nPROP4:FOO 8\r\nPROP4:FOO 9\r\nPROP4:FOO 10\r\nPROPNUMBERFIVE:FOO\r\nPROPNUMBERSIX:FOO\r\nPROPNUMBERSEVEN:FOO\r\nPROPNUMBEREIGHT:FOO\r\nPROPNUMBERNINE:FOO\r\nPROPNUMBERTEN:FOO\r\nUID:FOO\r\nEND:VCARD\r\n", $str); + self::assertEquals("BEGIN:VCARD\r\nVERSION:2.0\r\nSOMEPROP:FOO\r\nANOTHERPROP:FOO\r\nTHIRDPROP:FOO\r\nPROP4:FOO 1\r\nPROP4:FOO 2\r\nPROP4:FOO 3\r\nPROP4:FOO 4\r\nPROP4:FOO 5\r\nPROP4:FOO 6\r\nPROP4:FOO 7\r\nPROP4:FOO 8\r\nPROP4:FOO 9\r\nPROP4:FOO 10\r\nPROPNUMBERFIVE:FOO\r\nPROPNUMBERSIX:FOO\r\nPROPNUMBERSEVEN:FOO\r\nPROPNUMBEREIGHT:FOO\r\nPROPNUMBERNINE:FOO\r\nPROPNUMBERTEN:FOO\r\nUID:FOO\r\nEND:VCARD\r\n", $str); } public function testInstantiateWithChildren(): void @@ -409,8 +409,8 @@ public function testInstantiateWithChildren(): void 'FN' => 'Finn The Human', ]); - $this->assertEquals(['Acme Inc.', 'Section 9'], $comp->ORG->getParts()); - $this->assertEquals('Finn The Human', $comp->FN->getValue()); + self::assertEquals(['Acme Inc.', 'Section 9'], $comp->ORG->getParts()); + self::assertEquals('Finn The Human', $comp->FN->getValue()); } public function testInstantiateSubComponent(): void @@ -421,7 +421,7 @@ public function testInstantiateSubComponent(): void ]); $comp->add($event); - $this->assertEquals('12345', $comp->VEVENT->UID->getValue()); + self::assertEquals('12345', $comp->VEVENT->UID->getValue()); } public function testRemoveByName(): void @@ -432,8 +432,8 @@ public function testRemoveByName(): void $comp->add('prop2', 'val2'); $comp->remove('prop2'); - $this->assertFalse(isset($comp->prop2)); - $this->assertTrue(isset($comp->prop1)); + self::assertFalse(isset($comp->prop2)); + self::assertTrue(isset($comp->prop1)); } public function testRemoveByObj(): void @@ -443,8 +443,8 @@ public function testRemoveByObj(): void $prop = $comp->add('prop2', 'val2'); $comp->remove($prop); - $this->assertFalse(isset($comp->prop2)); - $this->assertTrue(isset($comp->prop1)); + self::assertFalse(isset($comp->prop2)); + self::assertTrue(isset($comp->prop1)); } /** @@ -470,7 +470,7 @@ public function testValidateRules(array $componentList, int $errorCount): void $component->add($v, 'Hello.'); } - $this->assertCount($errorCount, $component->validate()); + self::assertCount($errorCount, $component->validate()); } public function testValidateRepair(): void @@ -479,7 +479,7 @@ public function testValidateRepair(): void $component = new FakeComponent($vcard, 'Hi', [], false); $component->validate(Component::REPAIR); - $this->assertEquals('yow', $component->BAR->getValue()); + self::assertEquals('yow', $component->BAR->getValue()); } public function testValidateRepairShouldNotDeduplicatePropertiesWhenValuesDiffer(): void @@ -493,9 +493,9 @@ public function testValidateRepairShouldNotDeduplicatePropertiesWhenValuesDiffer $messages = $component->validate(Component::REPAIR); - $this->assertCount(1, $messages); - $this->assertEquals(3, $messages[0]['level']); - $this->assertCount(2, $component->GIR); + self::assertCount(1, $messages); + self::assertEquals(3, $messages[0]['level']); + self::assertCount(2, $component->GIR); } public function testValidateRepairShouldNotDeduplicatePropertiesWhenParametersDiffer(): void @@ -509,9 +509,9 @@ public function testValidateRepairShouldNotDeduplicatePropertiesWhenParametersDi $messages = $component->validate(Component::REPAIR); - $this->assertCount(1, $messages); - $this->assertEquals(3, $messages[0]['level']); - $this->assertCount(2, $component->GIR); + self::assertCount(1, $messages); + self::assertEquals(3, $messages[0]['level']); + self::assertCount(2, $component->GIR); } public function testValidateRepairShouldDeduplicatePropertiesWhenValuesAndParametersAreEqual(): void @@ -525,9 +525,9 @@ public function testValidateRepairShouldDeduplicatePropertiesWhenValuesAndParame $messages = $component->validate(Component::REPAIR); - $this->assertCount(1, $messages); - $this->assertEquals(1, $messages[0]['level']); - $this->assertCount(1, $component->GIR); + self::assertCount(1, $messages); + self::assertEquals(1, $messages[0]['level']); + self::assertCount(1, $component->GIR); } public function testValidateRepairShouldDeduplicatePropertiesWhenValuesAreEqual(): void @@ -541,9 +541,9 @@ public function testValidateRepairShouldDeduplicatePropertiesWhenValuesAreEqual( $messages = $component->validate(Component::REPAIR); - $this->assertCount(1, $messages); - $this->assertEquals(1, $messages[0]['level']); - $this->assertCount(1, $component->GIR); + self::assertCount(1, $messages); + self::assertEquals(1, $messages[0]['level']); + self::assertCount(1, $component->GIR); } public function ruleData(): array diff --git a/tests/VObject/DateTimeParserTest.php b/tests/VObject/DateTimeParserTest.php index a9612a14..b1e7f7cd 100644 --- a/tests/VObject/DateTimeParserTest.php +++ b/tests/VObject/DateTimeParserTest.php @@ -11,13 +11,13 @@ class DateTimeParserTest extends TestCase */ public function testParseICalendarDuration(): void { - $this->assertEquals('+1 weeks', DateTimeParser::parseDurationAsString('P1W')); - $this->assertEquals('+5 days', DateTimeParser::parseDurationAsString('P5D')); - $this->assertEquals('+5 days 3 hours 50 minutes 12 seconds', DateTimeParser::parseDurationAsString('P5DT3H50M12S')); - $this->assertEquals('-1 weeks 50 minutes', DateTimeParser::parseDurationAsString('-P1WT50M')); - $this->assertEquals('+50 days 3 hours 2 seconds', DateTimeParser::parseDurationAsString('+P50DT3H2S')); - $this->assertEquals('+0 seconds', DateTimeParser::parseDurationAsString('+PT0S')); - $this->assertEquals(new \DateInterval('PT0S'), DateTimeParser::parseDuration('PT0S')); + self::assertEquals('+1 weeks', DateTimeParser::parseDurationAsString('P1W')); + self::assertEquals('+5 days', DateTimeParser::parseDurationAsString('P5D')); + self::assertEquals('+5 days 3 hours 50 minutes 12 seconds', DateTimeParser::parseDurationAsString('P5DT3H50M12S')); + self::assertEquals('-1 weeks 50 minutes', DateTimeParser::parseDurationAsString('-P1WT50M')); + self::assertEquals('+50 days 3 hours 2 seconds', DateTimeParser::parseDurationAsString('+P50DT3H2S')); + self::assertEquals('+0 seconds', DateTimeParser::parseDurationAsString('+PT0S')); + self::assertEquals(new \DateInterval('PT0S'), DateTimeParser::parseDuration('PT0S')); } /** @@ -26,12 +26,12 @@ public function testParseICalendarDuration(): void public function testParseICalendarDurationDateInterval(): void { $expected = new \DateInterval('P7D'); - $this->assertEquals($expected, DateTimeParser::parseDuration('P1W')); - $this->assertEquals($expected, DateTimeParser::parse('P1W')); + self::assertEquals($expected, DateTimeParser::parseDuration('P1W')); + self::assertEquals($expected, DateTimeParser::parse('P1W')); $expected = new \DateInterval('PT3M'); $expected->invert = true; - $this->assertEquals($expected, DateTimeParser::parseDuration('-PT3M')); + self::assertEquals($expected, DateTimeParser::parseDuration('-PT3M')); } public function testParseICalendarDurationFail(): void @@ -46,7 +46,7 @@ public function testParseICalendarDateTime(): void $compare = new \DateTimeImmutable('2010-03-16 14:14:05', new \DateTimeZone('UTC')); - $this->assertEquals($compare, $dateTime); + self::assertEquals($compare, $dateTime); } /** @@ -75,7 +75,7 @@ public function testParseICalendarDateTimeUTC(): void $dateTime = DateTimeParser::parseDateTime('20100316T141405Z'); $compare = new \DateTimeImmutable('2010-03-16 14:14:05', new \DateTimeZone('UTC')); - $this->assertEquals($compare, $dateTime); + self::assertEquals($compare, $dateTime); } /** @@ -86,7 +86,7 @@ public function testParseICalendarDateTimeUTC2(): void $dateTime = DateTimeParser::parseDateTime('20101211T160000Z'); $compare = new \DateTimeImmutable('2010-12-11 16:00:00', new \DateTimeZone('UTC')); - $this->assertEquals($compare, $dateTime); + self::assertEquals($compare, $dateTime); } /** @@ -97,7 +97,7 @@ public function testParseICalendarDateTimeCustomTimeZone(): void $dateTime = DateTimeParser::parseDateTime('20100316T141405', new \DateTimeZone('Europe/Amsterdam')); $compare = new \DateTimeImmutable('2010-03-16 14:14:05', new \DateTimeZone('Europe/Amsterdam')); - $this->assertEquals($compare, $dateTime); + self::assertEquals($compare, $dateTime); } public function testParseICalendarDate(): void @@ -106,10 +106,10 @@ public function testParseICalendarDate(): void $expected = new \DateTimeImmutable('2010-03-16 00:00:00', new \DateTimeZone('UTC')); - $this->assertEquals($expected, $dateTime); + self::assertEquals($expected, $dateTime); $dateTime = DateTimeParser::parse('20100316'); - $this->assertEquals($expected, $dateTime); + self::assertEquals($expected, $dateTime); } /** @@ -121,10 +121,10 @@ public function testParseICalendarDateGreaterThan4000(): void $expected = new \DateTimeImmutable('4500-12-31 00:00:00', new \DateTimeZone('UTC')); - $this->assertEquals($expected, $dateTime); + self::assertEquals($expected, $dateTime); $dateTime = DateTimeParser::parse('45001231'); - $this->assertEquals($expected, $dateTime); + self::assertEquals($expected, $dateTime); } /** @@ -136,10 +136,10 @@ public function testParseICalendarDateTimeGreaterThan4000(): void $expected = new \DateTimeImmutable('4500-12-31 23:59:59', new \DateTimeZone('UTC')); - $this->assertEquals($expected, $dateTime); + self::assertEquals($expected, $dateTime); $dateTime = DateTimeParser::parse('45001231T235959'); - $this->assertEquals($expected, $dateTime); + self::assertEquals($expected, $dateTime); } /** @@ -165,7 +165,7 @@ public function testParseICalendarDateInvalidDate(): void */ public function testVCardDate(string $input, array $output): void { - $this->assertEquals( + self::assertEquals( $output, DateTimeParser::parseVCardDateTime($input) ); @@ -413,7 +413,7 @@ public function vcardDates(): array public function testDateAndOrTimeDateWithYearMonthDay(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '20150128', [ 'year' => '2015', @@ -425,7 +425,7 @@ public function testDateAndOrTimeDateWithYearMonthDay(): void public function testDateAndOrTimeDateWithYearMonth(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '2015-01', [ 'year' => '2015', @@ -436,7 +436,7 @@ public function testDateAndOrTimeDateWithYearMonth(): void public function testDateAndOrTimeDateWithMonth(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '--01', [ 'month' => '01', @@ -446,7 +446,7 @@ public function testDateAndOrTimeDateWithMonth(): void public function testDateAndOrTimeDateWithMonthDay(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '--0128', [ 'month' => '01', @@ -457,7 +457,7 @@ public function testDateAndOrTimeDateWithMonthDay(): void public function testDateAndOrTimeDateWithDay(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '---28', [ 'date' => '28', @@ -467,7 +467,7 @@ public function testDateAndOrTimeDateWithDay(): void public function testDateAndOrTimeTimeWithHour(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '13', [ 'hour' => '13', @@ -477,7 +477,7 @@ public function testDateAndOrTimeTimeWithHour(): void public function testDateAndOrTimeTimeWithHourMinute(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '1353', [ 'hour' => '13', @@ -488,7 +488,7 @@ public function testDateAndOrTimeTimeWithHourMinute(): void public function testDateAndOrTimeTimeWithHourSecond(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '135301', [ 'hour' => '13', @@ -500,7 +500,7 @@ public function testDateAndOrTimeTimeWithHourSecond(): void public function testDateAndOrTimeTimeWithMinute(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '-53', [ 'minute' => '53', @@ -510,7 +510,7 @@ public function testDateAndOrTimeTimeWithMinute(): void public function testDateAndOrTimeTimeWithMinuteSecond(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '-5301', [ 'minute' => '53', @@ -521,7 +521,7 @@ public function testDateAndOrTimeTimeWithMinuteSecond(): void public function testDateAndOrTimeTimeWithSecond(): void { - $this->assertTrue(true); + self::assertTrue(true); /* * This is unreachable due to a conflict between date and time pattern. @@ -531,7 +531,7 @@ public function testDateAndOrTimeTimeWithSecond(): void public function testDateAndOrTimeTimeWithSecondZ(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '--01Z', [ 'second' => '01', @@ -542,7 +542,7 @@ public function testDateAndOrTimeTimeWithSecondZ(): void public function testDateAndOrTimeTimeWithSecondTZ(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '--01+1234', [ 'second' => '01', @@ -553,7 +553,7 @@ public function testDateAndOrTimeTimeWithSecondTZ(): void public function testDateAndOrTimeDateTimeWithYearMonthDayHour(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '20150128T13', [ 'year' => '2015', @@ -566,7 +566,7 @@ public function testDateAndOrTimeDateTimeWithYearMonthDayHour(): void public function testDateAndOrTimeDateTimeWithMonthDayHour(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '--0128T13', [ 'month' => '01', @@ -578,7 +578,7 @@ public function testDateAndOrTimeDateTimeWithMonthDayHour(): void public function testDateAndOrTimeDateTimeWithDayHour(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '---28T13', [ 'date' => '28', @@ -589,7 +589,7 @@ public function testDateAndOrTimeDateTimeWithDayHour(): void public function testDateAndOrTimeDateTimeWithDayHourMinute(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '---28T1353', [ 'date' => '28', @@ -601,7 +601,7 @@ public function testDateAndOrTimeDateTimeWithDayHourMinute(): void public function testDateAndOrTimeDateTimeWithDayHourMinuteSecond(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '---28T135301', [ 'date' => '28', @@ -614,7 +614,7 @@ public function testDateAndOrTimeDateTimeWithDayHourMinuteSecond(): void public function testDateAndOrTimeDateTimeWithDayHourZ(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '---28T13Z', [ 'date' => '28', @@ -626,7 +626,7 @@ public function testDateAndOrTimeDateTimeWithDayHourZ(): void public function testDateAndOrTimeDateTimeWithDayHourTZ(): void { - $this->assertDateAndOrTimeEqualsTo( + self::assertDateAndOrTimeEqualsTo( '---28T13+1234', [ 'date' => '28', @@ -638,7 +638,7 @@ public function testDateAndOrTimeDateTimeWithDayHourTZ(): void protected function assertDateAndOrTimeEqualsTo(string $date, array $parts): void { - $this->assertSame( + self::assertSame( DateTimeParser::parseVCardDateAndOrTime($date), array_merge( [ diff --git a/tests/VObject/DocumentTest.php b/tests/VObject/DocumentTest.php index d5b2f145..d03a8883 100644 --- a/tests/VObject/DocumentTest.php +++ b/tests/VObject/DocumentTest.php @@ -9,13 +9,13 @@ class DocumentTest extends TestCase public function testGetDocumentType(): void { $doc = new MockDocument('WHATEVER'); - $this->assertEquals(Document::UNKNOWN, $doc->getDocumentType()); + self::assertEquals(Document::UNKNOWN, $doc->getDocumentType()); } public function testConstruct(): void { $doc = new MockDocument('VLIST'); - $this->assertEquals('VLIST', $doc->name); + self::assertEquals('VLIST', $doc->name); } public function testCreateComponent(): void @@ -24,11 +24,11 @@ public function testCreateComponent(): void $event = $vcal->createComponent('VEVENT'); - $this->assertInstanceOf(Component\VEvent::class, $event); + self::assertInstanceOf(Component\VEvent::class, $event); $vcal->add($event); $prop = $vcal->createProperty('X-PROP', '1234256', ['X-PARAM' => '3']); - $this->assertInstanceOf(Property::class, $prop); + self::assertInstanceOf(Property::class, $prop); $event->add($prop); @@ -38,7 +38,7 @@ public function testCreateComponent(): void ); $out = $vcal->serialize(); - $this->assertEquals("BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nX-PROP;X-PARAM=3:1234256\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n", $out); + self::assertEquals("BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nX-PROP;X-PARAM=3:1234256\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n", $out); } public function testCreate(): void @@ -46,17 +46,17 @@ public function testCreate(): void $vcal = new Component\VCalendar([], false); $event = $vcal->create('VEVENT'); - $this->assertInstanceOf(Component\VEvent::class, $event); + self::assertInstanceOf(Component\VEvent::class, $event); $prop = $vcal->create('CALSCALE'); - $this->assertInstanceOf(Property\Text::class, $prop); + self::assertInstanceOf(Property\Text::class, $prop); } public function testGetClassNameForPropertyValue(): void { $vcal = new Component\VCalendar([], false); - $this->assertEquals(Property\Text::class, $vcal->getClassNameForPropertyValue('TEXT')); - $this->assertNull($vcal->getClassNameForPropertyValue('FOO')); + self::assertEquals(Property\Text::class, $vcal->getClassNameForPropertyValue('TEXT')); + self::assertNull($vcal->getClassNameForPropertyValue('FOO')); } /** @@ -67,18 +67,18 @@ public function testDestroy(): void $vcal = new Component\VCalendar([], false); $event = $vcal->createComponent('VEVENT'); - $this->assertInstanceOf(Component\VEvent::class, $event); + self::assertInstanceOf(Component\VEvent::class, $event); $vcal->add($event); $prop = $vcal->createProperty('X-PROP', '1234256', ['X-PARAM' => '3']); $event->add($prop); - $this->assertEquals($event, $prop->parent); + self::assertEquals($event, $prop->parent); $vcal->destroy(); - $this->assertNull($prop->parent); + self::assertNull($prop->parent); } } diff --git a/tests/VObject/ElementListTest.php b/tests/VObject/ElementListTest.php index 9cf4c7fd..22b616fb 100644 --- a/tests/VObject/ElementListTest.php +++ b/tests/VObject/ElementListTest.php @@ -22,12 +22,12 @@ public function testIterate(): void $count = 0; foreach ($elemList as $key => $subcomponent) { ++$count; - $this->assertInstanceOf(Component::class, $subcomponent); + self::assertInstanceOf(Component::class, $subcomponent); if (3 === $count) { - $this->assertEquals(2, $key); + self::assertEquals(2, $key); } } - $this->assertEquals(3, $count); + self::assertEquals(3, $count); } } diff --git a/tests/VObject/EmClientTest.php b/tests/VObject/EmClientTest.php index 357df774..0af6fdb2 100644 --- a/tests/VObject/EmClientTest.php +++ b/tests/VObject/EmClientTest.php @@ -49,6 +49,6 @@ public function testParseTz(): void $vObject = Reader::read($str); $dt = $vObject->VEVENT->DTSTART->getDateTime(); - $this->assertEquals(new \DateTimeImmutable('2011-10-08 19:30:00', new \DateTimeZone('America/Chicago')), $dt); + self::assertEquals(new \DateTimeImmutable('2011-10-08 19:30:00', new \DateTimeZone('America/Chicago')), $dt); } } diff --git a/tests/VObject/EmptyParameterTest.php b/tests/VObject/EmptyParameterTest.php index 86b3c82d..ab197ab3 100644 --- a/tests/VObject/EmptyParameterTest.php +++ b/tests/VObject/EmptyParameterTest.php @@ -20,14 +20,14 @@ public function testRead(): void $vcard = Reader::read($input); - $this->assertInstanceOf(Component\VCard::class, $vcard); + self::assertInstanceOf(Component\VCard::class, $vcard); $vcard = $vcard->convert(\Sabre\VObject\Document::VCARD30); $vcard = $vcard->serialize(); $converted = Reader::read($vcard); $converted->validate(); - $this->assertTrue(isset($converted->EMAIL['X-INTERN'])); + self::assertTrue(isset($converted->EMAIL['X-INTERN'])); $version = Version::VERSION; @@ -43,7 +43,7 @@ public function testRead(): void VCF; - $this->assertEquals($expected, str_replace("\r", '', $vcard)); + self::assertEquals($expected, str_replace("\r", '', $vcard)); } public function testVCard21Parameter(): void @@ -64,6 +64,6 @@ public function testVCard21Parameter(): void '', ]; - $this->assertEquals(implode("\r\n", $expected), $result); + self::assertEquals(implode("\r\n", $expected), $result); } } diff --git a/tests/VObject/EmptyValueIssueTest.php b/tests/VObject/EmptyValueIssueTest.php index 7c90b0dc..533ac6ab 100644 --- a/tests/VObject/EmptyValueIssueTest.php +++ b/tests/VObject/EmptyValueIssueTest.php @@ -25,6 +25,6 @@ public function testDecodeValue(): void $vobj = Reader::read($input); // Before this bug was fixed, getValue() would return nothing. - $this->assertEquals("This is a description\nwith a linebreak and a ; , and :", $vobj->VEVENT->DESCRIPTION->getValue()); + self::assertEquals("This is a description\nwith a linebreak and a ; , and :", $vobj->VEVENT->DESCRIPTION->getValue()); } } diff --git a/tests/VObject/FreeBusyDataTest.php b/tests/VObject/FreeBusyDataTest.php index 8a0aad64..10b2f403 100644 --- a/tests/VObject/FreeBusyDataTest.php +++ b/tests/VObject/FreeBusyDataTest.php @@ -10,7 +10,7 @@ public function testGetData(): void { $fb = new FreeBusyData(100, 200); - $this->assertEquals( + self::assertEquals( [ [ 'start' => 100, @@ -32,7 +32,7 @@ public function testAddBeginning(): void // Overwriting the first half $fb->add(100, 150, 'BUSY'); - $this->assertEquals( + self::assertEquals( [ [ 'start' => 100, @@ -51,7 +51,7 @@ public function testAddBeginning(): void // Overwriting the first half again $fb->add(100, 150, 'BUSY-TENTATIVE'); - $this->assertEquals( + self::assertEquals( [ [ 'start' => 100, @@ -78,7 +78,7 @@ public function testAddEnd(): void // Overwriting the first half $fb->add(150, 200, 'BUSY'); - $this->assertEquals( + self::assertEquals( [ [ 'start' => 100, @@ -105,7 +105,7 @@ public function testAddMiddle(): void // Overwriting the first half $fb->add(150, 160, 'BUSY'); - $this->assertEquals( + self::assertEquals( [ [ 'start' => 100, @@ -137,7 +137,7 @@ public function testAddMultiple(): void $fb->add(110, 120, 'BUSY'); $fb->add(130, 140, 'BUSY'); - $this->assertEquals( + self::assertEquals( [ [ 'start' => 100, @@ -179,7 +179,7 @@ public function testAddMultipleOverlap(): void $fb->add(110, 120, 'BUSY'); $fb->add(130, 140, 'BUSY'); - $this->assertEquals( + self::assertEquals( [ [ 'start' => 100, @@ -212,7 +212,7 @@ public function testAddMultipleOverlap(): void $fb->add(115, 135, 'BUSY-TENTATIVE'); - $this->assertEquals( + self::assertEquals( [ [ 'start' => 100, @@ -254,7 +254,7 @@ public function testAddMultipleOverlapAndMerge(): void $fb->add(110, 120, 'BUSY'); $fb->add(130, 140, 'BUSY'); - $this->assertEquals( + self::assertEquals( [ [ 'start' => 100, @@ -287,7 +287,7 @@ public function testAddMultipleOverlapAndMerge(): void $fb->add(115, 135, 'BUSY'); - $this->assertEquals( + self::assertEquals( [ [ 'start' => 100, diff --git a/tests/VObject/FreeBusyGeneratorTest.php b/tests/VObject/FreeBusyGeneratorTest.php index 8167a10c..e4715f63 100644 --- a/tests/VObject/FreeBusyGeneratorTest.php +++ b/tests/VObject/FreeBusyGeneratorTest.php @@ -19,7 +19,7 @@ public function testGeneratorBaseObject(): void $result = $gen->getResult(); - $this->assertEquals('PUBLISH', $result->METHOD->getValue()); + self::assertEquals('PUBLISH', $result->METHOD->getValue()); } public function testInvalidArg(): void @@ -78,7 +78,7 @@ public function assertFreeBusyReport(string $expected, $input, \DateTimeZone $ti END:VCALENDAR ICS; - $this->assertVObjectEqualsVObject($expected, $output); + self::assertVObjectEqualsVObject($expected, $output); } public function testSimple(): void @@ -93,7 +93,7 @@ public function testSimple(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( 'FREEBUSY:20110101T120000Z/20110101T130000Z', $blob ); @@ -114,7 +114,7 @@ public function testSource(): void fwrite($h, $blob); rewind($h); - $this->assertFreeBusyReport( + self::assertFreeBusyReport( 'FREEBUSY:20110101T120000Z/20110101T130000Z', $h ); @@ -136,7 +136,7 @@ public function testOpaque(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( 'FREEBUSY:20110101T130000Z/20110101T140000Z', $blob ); @@ -159,7 +159,7 @@ public function testTransparent(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( '', $blob ); @@ -182,7 +182,7 @@ public function testCancelled(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( '', $blob ); @@ -205,7 +205,7 @@ public function testTentative(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( 'FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T180000Z/20110101T190000Z', $blob ); @@ -227,7 +227,7 @@ public function testOutsideTimeRange(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( '', $blob ); @@ -249,7 +249,7 @@ public function testOutsideTimeRange2(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( '', $blob ); @@ -271,7 +271,7 @@ public function testDuration(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( 'FREEBUSY:20110101T190000Z/20110101T200000Z', $blob ); @@ -292,7 +292,7 @@ public function testAllDay(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( 'FREEBUSY:20110102T000000Z/20110103T000000Z', $blob ); @@ -313,7 +313,7 @@ public function testNoDuration(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( '', $blob ); @@ -335,7 +335,7 @@ public function testObject(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( 'FREEBUSY:20110101T210000Z/20110101T220000Z', Reader::read($blob) ); @@ -359,7 +359,7 @@ public function testVFreeBusy(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( "FREEBUSY:20110103T010000Z/20110103T020000Z\n". 'FREEBUSY:20110103T030000Z/20110103T060000Z', $blob @@ -380,7 +380,7 @@ public function testYearlyRecurrence(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( 'FREEBUSY:20110101T220000Z/20110101T230000Z', $blob ); @@ -400,7 +400,7 @@ public function testYearlyRecurrenceDuration(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( 'FREEBUSY:20110101T230000Z/20110102T000000Z', $blob ); @@ -419,7 +419,7 @@ public function testFloatingTime(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( 'FREEBUSY:20110101T120000Z/20110101T130000Z', $blob ); @@ -438,7 +438,7 @@ public function testFloatingTimeReferenceTimeZone(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( 'FREEBUSY:20110101T170000Z/20110101T180000Z', $blob, new \DateTimeZone('America/Toronto') @@ -457,7 +457,7 @@ public function testAllDay2(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( 'FREEBUSY:20110101T110000Z/20110102T000000Z', $blob ); @@ -475,7 +475,7 @@ public function testAllDayReferenceTimeZone(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( 'FREEBUSY:20110101T110000Z/20110102T050000Z', $blob, new \DateTimeZone('America/Toronto') @@ -497,7 +497,7 @@ public function testNoValidInstances(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( '', $blob ); @@ -532,7 +532,7 @@ public function testVAvailabilitySimple(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( "FREEBUSY;FBTYPE=BUSY-UNAVAILABLE:20110101T110000Z/20110101T120000Z\n". "FREEBUSY:20110101T120000Z/20110101T130000Z\n". 'FREEBUSY;FBTYPE=BUSY-UNAVAILABLE:20110101T130000Z/20110103T110000Z', @@ -571,7 +571,7 @@ public function testVAvailabilityIrrelevant(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( 'FREEBUSY:20110101T120000Z/20110101T130000Z', $blob, null, @@ -610,7 +610,7 @@ public function testVAvailabilityOfficeHours(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( "FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T110000Z/20110101T120000Z\n". "FREEBUSY:20110101T120000Z/20110101T130000Z\n". "FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T130000Z/20110103T090000Z\n", @@ -658,7 +658,7 @@ public function testVAvailabilityOfficeHoursVacation(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( 'FREEBUSY:20110101T110000Z/20110103T110000Z', $blob, null, @@ -706,7 +706,7 @@ public function testVAvailabilityOfficeHoursVacation2(): void END:VCALENDAR ICS; - $this->assertFreeBusyReport( + self::assertFreeBusyReport( "FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T110000Z/20110101T120000Z\n". "FREEBUSY:20110101T120000Z/20110101T130000Z\n". "FREEBUSY;FBTYPE=BUSY-TENTATIVE:20110101T130000Z/20110103T090000Z\n", diff --git a/tests/VObject/GoogleColonEscapingTest.php b/tests/VObject/GoogleColonEscapingTest.php index 16f07b5e..fa2ba8a7 100644 --- a/tests/VObject/GoogleColonEscapingTest.php +++ b/tests/VObject/GoogleColonEscapingTest.php @@ -26,6 +26,6 @@ public function testDecode(): void VCF; $vobj = Reader::read($vcard); - $this->assertEquals('http://www.rooftopsolutions.nl/', $vobj->URL->getValue()); + self::assertEquals('http://www.rooftopsolutions.nl/', $vobj->URL->getValue()); } } diff --git a/tests/VObject/ICalendar/AttachParseTest.php b/tests/VObject/ICalendar/AttachParseTest.php index b55659d5..cb54eb34 100644 --- a/tests/VObject/ICalendar/AttachParseTest.php +++ b/tests/VObject/ICalendar/AttachParseTest.php @@ -24,7 +24,7 @@ public function testParseAttach(): void $vcal = Reader::read($vcal); $prop = $vcal->VEVENT->ATTACH; - $this->assertInstanceOf(Uri::class, $prop); - $this->assertEquals('ftp://example.com/pub/reports/r-960812.ps', $prop->getValue()); + self::assertInstanceOf(Uri::class, $prop); + self::assertEquals('ftp://example.com/pub/reports/r-960812.ps', $prop->getValue()); } } diff --git a/tests/VObject/ITip/BrokerTester.php b/tests/VObject/ITip/BrokerTester.php index 8f79536c..cc01ed3f 100644 --- a/tests/VObject/ITip/BrokerTester.php +++ b/tests/VObject/ITip/BrokerTester.php @@ -28,19 +28,19 @@ public function parse($oldMessage, $newMessage, array $expected = [], string $cu $broker = new Broker(); $result = $broker->parseEvent($newMessage, $currentUser, $oldMessage); - $this->assertSameSize($expected, $result); + self::assertSameSize($expected, $result); foreach ($expected as $index => $ex) { $message = $result[$index]; foreach ($ex as $key => $val) { if ('message' === $key) { - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $val, $message->message->serialize() ); } else { - $this->assertEquals($val, $message->$key); + self::assertEquals($val, $message->$key); } } } @@ -93,12 +93,12 @@ public function process($input, $existingObject = null, $expected = false): void $result = $broker->processMessage($message, $existingObject); if (is_null($expected)) { - $this->assertTrue(!$result); + self::assertTrue(!$result); return; } - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $expected, $result ); diff --git a/tests/VObject/ITip/BrokerTimezoneInParseEventInfoWithoutMasterTest.php b/tests/VObject/ITip/BrokerTimezoneInParseEventInfoWithoutMasterTest.php index 8e6b3aed..e3f18f15 100644 --- a/tests/VObject/ITip/BrokerTimezoneInParseEventInfoWithoutMasterTest.php +++ b/tests/VObject/ITip/BrokerTimezoneInParseEventInfoWithoutMasterTest.php @@ -72,7 +72,7 @@ public function testTimezoneInParseEventInfoWithoutMaster(): void $reflectionMethod = new \ReflectionMethod($broker, 'parseEventInfo'); $reflectionMethod->setAccessible(true); $data = $reflectionMethod->invoke($broker, $calendar); - $this->assertInstanceOf('DateTimeZone', $data['timezone']); - $this->assertEquals('Europe/Minsk', $data['timezone']->getName()); + self::assertInstanceOf('DateTimeZone', $data['timezone']); + self::assertEquals('Europe/Minsk', $data['timezone']->getName()); } } diff --git a/tests/VObject/ITip/MessageTest.php b/tests/VObject/ITip/MessageTest.php index 25bfcbdc..3196c1aa 100644 --- a/tests/VObject/ITip/MessageTest.php +++ b/tests/VObject/ITip/MessageTest.php @@ -9,7 +9,7 @@ class MessageTest extends TestCase public function testNoScheduleStatus(): void { $message = new Message(); - $this->assertFalse($message->getScheduleStatus()); + self::assertFalse($message->getScheduleStatus()); } public function testScheduleStatus(): void @@ -17,7 +17,7 @@ public function testScheduleStatus(): void $message = new Message(); $message->scheduleStatus = '1.2;Delivered'; - $this->assertEquals('1.2', $message->getScheduleStatus()); + self::assertEquals('1.2', $message->getScheduleStatus()); } public function testUnexpectedScheduleStatus(): void @@ -25,6 +25,6 @@ public function testUnexpectedScheduleStatus(): void $message = new Message(); $message->scheduleStatus = '9.9.9'; - $this->assertEquals('9.9.9', $message->getScheduleStatus()); + self::assertEquals('9.9.9', $message->getScheduleStatus()); } } diff --git a/tests/VObject/Issue153Test.php b/tests/VObject/Issue153Test.php index 42576ed8..83e56cf5 100644 --- a/tests/VObject/Issue153Test.php +++ b/tests/VObject/Issue153Test.php @@ -9,6 +9,6 @@ class Issue153Test extends TestCase public function testRead(): void { $obj = Reader::read(file_get_contents(dirname(__FILE__).'/issue153.vcf')); - $this->assertEquals('Test Benutzer', (string) $obj->FN); + self::assertEquals('Test Benutzer', (string) $obj->FN); } } diff --git a/tests/VObject/Issue259Test.php b/tests/VObject/Issue259Test.php index ac6c2cdc..5c014ad3 100644 --- a/tests/VObject/Issue259Test.php +++ b/tests/VObject/Issue259Test.php @@ -17,7 +17,7 @@ public function testParsingJcalWithUntil(): void $event = reset($eventAsArray); $rruleAsArray = $event->select('RRULE'); $rrule = reset($rruleAsArray); - $this->assertNotNull($rrule); - $this->assertEquals('FREQ=MONTHLY;UNTIL=20160101T220000Z', $rrule->getValue()); + self::assertNotNull($rrule); + self::assertEquals('FREQ=MONTHLY;UNTIL=20160101T220000Z', $rrule->getValue()); } } diff --git a/tests/VObject/Issue36WorkAroundTest.php b/tests/VObject/Issue36WorkAroundTest.php index bac66bbb..e6c4f254 100644 --- a/tests/VObject/Issue36WorkAroundTest.php +++ b/tests/VObject/Issue36WorkAroundTest.php @@ -34,6 +34,6 @@ public function testWorkaround(): void // If this does not throw an exception, it's all good. $it = new Recur\EventIterator($obj, '1833bd44-188b-405c-9f85-1a12105318aa'); - $this->assertInstanceOf(Recur\EventIterator::class, $it); + self::assertInstanceOf(Recur\EventIterator::class, $it); } } diff --git a/tests/VObject/Issue40Test.php b/tests/VObject/Issue40Test.php index f44a28c2..3d280ed4 100644 --- a/tests/VObject/Issue40Test.php +++ b/tests/VObject/Issue40Test.php @@ -27,6 +27,6 @@ public function testEncode(): void '', ]); - $this->assertEquals($expected, $card->serialize()); + self::assertEquals($expected, $card->serialize()); } } diff --git a/tests/VObject/Issue64Test.php b/tests/VObject/Issue64Test.php index f102b111..110f91fa 100644 --- a/tests/VObject/Issue64Test.php +++ b/tests/VObject/Issue64Test.php @@ -14,6 +14,6 @@ public function testRead(): void $converted = Reader::read($vcard); - $this->assertInstanceOf(Component\VCard::class, $converted); + self::assertInstanceOf(Component\VCard::class, $converted); } } diff --git a/tests/VObject/Issue96Test.php b/tests/VObject/Issue96Test.php index 0f523ced..137149e8 100644 --- a/tests/VObject/Issue96Test.php +++ b/tests/VObject/Issue96Test.php @@ -18,7 +18,7 @@ public function testRead(): void VCF; $vcard = Reader::read($input, Reader::OPTION_FORGIVING); - $this->assertInstanceOf(Component\VCard::class, $vcard); - $this->assertEquals('http://www.example.org', $vcard->URL->getValue()); + self::assertInstanceOf(Component\VCard::class, $vcard); + self::assertEquals('http://www.example.org', $vcard->URL->getValue()); } } diff --git a/tests/VObject/JCalTest.php b/tests/VObject/JCalTest.php index 826d95bc..fa347966 100644 --- a/tests/VObject/JCalTest.php +++ b/tests/VObject/JCalTest.php @@ -144,6 +144,6 @@ public function testToJCal(): void ], ]; - $this->assertEquals($expected, $cal->jsonSerialize()); + self::assertEquals($expected, $cal->jsonSerialize()); } } diff --git a/tests/VObject/JCardTest.php b/tests/VObject/JCardTest.php index 37dd7b47..cbd56ba9 100644 --- a/tests/VObject/JCardTest.php +++ b/tests/VObject/JCardTest.php @@ -189,6 +189,6 @@ public function testToJCard(): void ], ]; - $this->assertEquals($expected, $card->jsonSerialize()); + self::assertEquals($expected, $card->jsonSerialize()); } } diff --git a/tests/VObject/LineFoldingIssueTest.php b/tests/VObject/LineFoldingIssueTest.php index 4b9f0190..5e636d36 100644 --- a/tests/VObject/LineFoldingIssueTest.php +++ b/tests/VObject/LineFoldingIssueTest.php @@ -18,6 +18,6 @@ public function testRead(): void ICS; $obj = Reader::read($event); - $this->assertEquals($event, $obj->serialize()); + self::assertEquals($event, $obj->serialize()); } } diff --git a/tests/VObject/ParameterTest.php b/tests/VObject/ParameterTest.php index 3c59b774..4c9f2c77 100644 --- a/tests/VObject/ParameterTest.php +++ b/tests/VObject/ParameterTest.php @@ -11,8 +11,8 @@ public function testSetup(): void $cal = new Component\VCalendar(); $param = new Parameter($cal, 'name', 'value'); - $this->assertEquals('NAME', $param->name); - $this->assertEquals('value', $param->getValue()); + self::assertEquals('NAME', $param->name); + self::assertEquals('value', $param->getValue()); } public function testSetupNameLess(): void @@ -20,9 +20,9 @@ public function testSetupNameLess(): void $card = new Component\VCard(); $param = new Parameter($card, null, 'URL'); - $this->assertEquals('VALUE', $param->name); - $this->assertEquals('URL', $param->getValue()); - $this->assertTrue($param->noName); + self::assertEquals('VALUE', $param->name); + self::assertEquals('URL', $param->getValue()); + self::assertTrue($param->noName); } public function testModify(): void @@ -31,54 +31,54 @@ public function testModify(): void $param = new Parameter($cal, 'name', null); $param->addValue(1); - $this->assertEquals([1], $param->getParts()); + self::assertEquals([1], $param->getParts()); $param->setParts([1, 2]); - $this->assertEquals([1, 2], $param->getParts()); + self::assertEquals([1, 2], $param->getParts()); $param->addValue(3); - $this->assertEquals([1, 2, 3], $param->getParts()); + self::assertEquals([1, 2, 3], $param->getParts()); $param->setValue(4); $param->addValue(5); - $this->assertEquals([4, 5], $param->getParts()); + self::assertEquals([4, 5], $param->getParts()); } public function testCastToString(): void { $cal = new Component\VCalendar(); $param = new Parameter($cal, 'name', 'value'); - $this->assertEquals('value', $param->__toString()); - $this->assertEquals('value', (string) $param); + self::assertEquals('value', $param->__toString()); + self::assertEquals('value', (string) $param); } public function testCastNullToString(): void { $cal = new Component\VCalendar(); $param = new Parameter($cal, 'name', null); - $this->assertEquals('', $param->__toString()); - $this->assertEquals('', (string) $param); + self::assertEquals('', $param->__toString()); + self::assertEquals('', (string) $param); } public function testSerialize(): void { $cal = new Component\VCalendar(); $param = new Parameter($cal, 'name', 'value'); - $this->assertEquals('NAME=value', $param->serialize()); + self::assertEquals('NAME=value', $param->serialize()); } public function testSerializeEmpty(): void { $cal = new Component\VCalendar(); $param = new Parameter($cal, 'name', null); - $this->assertEquals('NAME=', $param->serialize()); + self::assertEquals('NAME=', $param->serialize()); } public function testSerializeComplex(): void { $cal = new Component\VCalendar(); $param = new Parameter($cal, 'name', ['val1', 'val2;', 'val3^', "val4\n", 'val5"']); - $this->assertEquals('NAME=val1,"val2;","val3^^","val4^n","val5^\'"', $param->serialize()); + self::assertEquals('NAME=val1,"val2;","val3^^","val4^n","val5^\'"', $param->serialize()); } /** @@ -91,7 +91,7 @@ public function testSerializePlusSign(): void { $cal = new Component\VCalendar(); $param = new Parameter($cal, 'EMAIL', 'user+something@example.org'); - $this->assertEquals('EMAIL="user+something@example.org"', $param->serialize()); + self::assertEquals('EMAIL="user+something@example.org"', $param->serialize()); } public function testIterate(): void @@ -105,20 +105,20 @@ public function testIterate(): void $result[] = $value; } - $this->assertEquals([1, 2, 3, 4], $result); + self::assertEquals([1, 2, 3, 4], $result); } public function testSerializeColon(): void { $cal = new Component\VCalendar(); $param = new Parameter($cal, 'name', 'va:lue'); - $this->assertEquals('NAME="va:lue"', $param->serialize()); + self::assertEquals('NAME="va:lue"', $param->serialize()); } public function testSerializeSemiColon(): void { $cal = new Component\VCalendar(); $param = new Parameter($cal, 'name', 'va;lue'); - $this->assertEquals('NAME="va;lue"', $param->serialize()); + self::assertEquals('NAME="va;lue"', $param->serialize()); } } diff --git a/tests/VObject/Parser/JsonTest.php b/tests/VObject/Parser/JsonTest.php index 3d118618..996e834e 100644 --- a/tests/VObject/Parser/JsonTest.php +++ b/tests/VObject/Parser/JsonTest.php @@ -189,9 +189,9 @@ public function testRoundTripJCard(): void END:VCARD VCF; - $this->assertEquals($expected, str_replace("\r", '', $result)); + self::assertEquals($expected, str_replace("\r", '', $result)); - $this->assertEquals( + self::assertEquals( $input, $vobj->jsonSerialize() ); @@ -345,9 +345,9 @@ public function testRoundTripJCal(): void END:VCALENDAR VCF; - $this->assertEquals($expected, str_replace("\r", '', $result)); + self::assertEquals($expected, str_replace("\r", '', $result)); - $this->assertEquals( + self::assertEquals( $input, $vobj->jsonSerialize() ); @@ -369,7 +369,7 @@ public function testParseStreamArg(): void rewind($stream); $result = VObject\Reader::readJson($stream, 0); - $this->assertEquals('foo', $result->FN->getValue()); + self::assertEquals('foo', $result->FN->getValue()); } public function testParseInvalidData(): void diff --git a/tests/VObject/Parser/MimeDirTest.php b/tests/VObject/Parser/MimeDirTest.php index af5f5181..24656f88 100644 --- a/tests/VObject/Parser/MimeDirTest.php +++ b/tests/VObject/Parser/MimeDirTest.php @@ -31,7 +31,7 @@ public function testDecodeLatin1(): void $mimeDir = new MimeDir(); $mimeDir->setCharset('ISO-8859-1'); $vcard = $mimeDir->parse($vcard); - $this->assertEquals("umlaut u - \xC3\xBC", $vcard->FN->getValue()); + self::assertEquals("umlaut u - \xC3\xBC", $vcard->FN->getValue()); } public function testDecodeInlineLatin1(): void @@ -45,7 +45,7 @@ public function testDecodeInlineLatin1(): void $mimeDir = new MimeDir(); $vcard = $mimeDir->parse($vcard); - $this->assertEquals("umlaut u - \xC3\xBC", $vcard->FN->getValue()); + self::assertEquals("umlaut u - \xC3\xBC", $vcard->FN->getValue()); } public function testIgnoreCharsetVCard30(): void @@ -59,7 +59,7 @@ public function testIgnoreCharsetVCard30(): void $mimeDir = new MimeDir(); $vcard = $mimeDir->parse($vcard); - $this->assertEquals("foo-bar - \xFC", $vcard->FN->getValue()); + self::assertEquals("foo-bar - \xFC", $vcard->FN->getValue()); } public function testDontDecodeLatin1(): void @@ -77,7 +77,7 @@ public function testDontDecodeLatin1(): void // the encoding was set to UTF-8. The result is actually invalid // and the validator should report this, but it tests effectively // that we pass through the string byte-by-byte. - $this->assertEquals("umlaut u - \xFC", $vcard->FN->getValue()); + self::assertEquals("umlaut u - \xFC", $vcard->FN->getValue()); } public function testDecodeUnsupportedCharset(): void @@ -113,7 +113,7 @@ public function testDecodeWindows1252(): void $mimeDir = new MimeDir(); $mimeDir->setCharset('Windows-1252'); $vcard = $mimeDir->parse($vcard); - $this->assertEquals("Euro \xE2\x82\xAC", $vcard->FN->getValue()); + self::assertEquals("Euro \xE2\x82\xAC", $vcard->FN->getValue()); } public function testDecodeWindows1252Inline(): void @@ -127,7 +127,7 @@ public function testDecodeWindows1252Inline(): void $mimeDir = new MimeDir(); $vcard = $mimeDir->parse($vcard); - $this->assertEquals("Euro \xE2\x82\xAC", $vcard->FN->getValue()); + self::assertEquals("Euro \xE2\x82\xAC", $vcard->FN->getValue()); } public function testCaseInsensitiveInlineCharset(): void @@ -143,8 +143,8 @@ public function testCaseInsensitiveInlineCharset(): void $mimeDir = new MimeDir(); $vcard = $mimeDir->parse($vcard); // we can do a simple assertion here. As long as we don't get an exception, everything is thing - $this->assertEquals('Euro', $vcard->FN->getValue()); - $this->assertEquals('Test2', $vcard->N->getValue()); + self::assertEquals('Euro', $vcard->FN->getValue()); + self::assertEquals('Test2', $vcard->N->getValue()); } public function testParsingTwiceSameContent(): void @@ -164,7 +164,7 @@ public function testParsingTwiceSameContent(): void $mimeDir = new MimeDir(); $vcard = $mimeDir->parse($card); // we can do a simple assertion here. As long as we don't get an exception, everything is fine - $this->assertEquals('20220612', $vcard->VEVENT->DTSTART->getValue()); + self::assertEquals('20220612', $vcard->VEVENT->DTSTART->getValue()); } /** @@ -176,7 +176,7 @@ public function testBrokenMultilineContentDoesNotBreakImportWhenSetToIgnoreBroke { $mimeDir = new MimeDir(null, MimeDir::OPTION_IGNORE_INVALID_LINES); $vcalendar = $mimeDir->parse($vcalendar); - $this->assertInstanceOf(VCalendar::class, $vcalendar); + self::assertInstanceOf(VCalendar::class, $vcalendar); } /** diff --git a/tests/VObject/Parser/QuotedPrintableTest.php b/tests/VObject/Parser/QuotedPrintableTest.php index eaec75e8..e8153604 100644 --- a/tests/VObject/Parser/QuotedPrintableTest.php +++ b/tests/VObject/Parser/QuotedPrintableTest.php @@ -15,10 +15,10 @@ public function testReadQuotedPrintableSimple(): void $result = Reader::read($data); - $this->assertInstanceOf(Component::class, $result); - $this->assertEquals('VCARD', $result->name); - $this->assertCount(1, $result->children()); - $this->assertEquals('Aachen', $this->getPropertyValue($result->LABEL)); + self::assertInstanceOf(Component::class, $result); + self::assertEquals('VCARD', $result->name); + self::assertCount(1, $result->children()); + self::assertEquals('Aachen', $this->getPropertyValue($result->LABEL)); } public function testReadQuotedPrintableNewlineSoft(): void @@ -26,10 +26,10 @@ public function testReadQuotedPrintableNewlineSoft(): void $data = "BEGIN:VCARD\r\nLABEL;ENCODING=QUOTED-PRINTABLE:Aa=\r\n ch=\r\n en\r\nEND:VCARD"; $result = Reader::read($data); - $this->assertInstanceOf(Component::class, $result); - $this->assertEquals('VCARD', $result->name); - $this->assertCount(1, $result->children()); - $this->assertEquals('Aachen', $this->getPropertyValue($result->LABEL)); + self::assertInstanceOf(Component::class, $result); + self::assertEquals('VCARD', $result->name); + self::assertCount(1, $result->children()); + self::assertEquals('Aachen', $this->getPropertyValue($result->LABEL)); } public function testReadQuotedPrintableNewlineHard(): void @@ -37,10 +37,10 @@ public function testReadQuotedPrintableNewlineHard(): void $data = "BEGIN:VCARD\r\nLABEL;ENCODING=QUOTED-PRINTABLE:Aachen=0D=0A=\r\n Germany\r\nEND:VCARD"; $result = Reader::read($data); - $this->assertInstanceOf(Component::class, $result); - $this->assertEquals('VCARD', $result->name); - $this->assertCount(1, $result->children()); - $this->assertEquals("Aachen\r\nGermany", $this->getPropertyValue($result->LABEL)); + self::assertInstanceOf(Component::class, $result); + self::assertEquals('VCARD', $result->name); + self::assertCount(1, $result->children()); + self::assertEquals("Aachen\r\nGermany", $this->getPropertyValue($result->LABEL)); } public function testReadQuotedPrintableCompatibilityMS(): void @@ -48,10 +48,10 @@ public function testReadQuotedPrintableCompatibilityMS(): void $data = "BEGIN:VCARD\r\nLABEL;ENCODING=QUOTED-PRINTABLE:Aachen=0D=0A=\r\nDeutschland:okay\r\nEND:VCARD"; $result = Reader::read($data, Reader::OPTION_FORGIVING); - $this->assertInstanceOf(Component::class, $result); - $this->assertEquals('VCARD', $result->name); - $this->assertCount(1, $result->children()); - $this->assertEquals("Aachen\r\nDeutschland:okay", $this->getPropertyValue($result->LABEL)); + self::assertInstanceOf(Component::class, $result); + self::assertEquals('VCARD', $result->name); + self::assertCount(1, $result->children()); + self::assertEquals("Aachen\r\nDeutschland:okay", $this->getPropertyValue($result->LABEL)); } public function testReadQuotesPrintableCompoundValues(): void @@ -67,7 +67,7 @@ public function testReadQuotesPrintableCompoundValues(): void VCF; $result = Reader::read($data, Reader::OPTION_FORGIVING); - $this->assertEquals([ + self::assertEquals([ '', '', 'Münster Str. 1', 'Münster', '', '48143', 'Deutschland', ], $result->ADR->getParts()); } diff --git a/tests/VObject/Parser/XmlTest.php b/tests/VObject/Parser/XmlTest.php index 8e7deca9..2276f7fd 100644 --- a/tests/VObject/Parser/XmlTest.php +++ b/tests/VObject/Parser/XmlTest.php @@ -11,7 +11,7 @@ class XmlTest extends TestCase public function testRFC6321Example1(): void { - $this->assertXMLEqualsToMimeDir( + self::assertXMLEqualsToMimeDir( << @@ -212,7 +212,7 @@ public function testRFC6321Example2(): void XML; $component = VObject\Reader::readXML($xml); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( 'BEGIN:VCALENDAR'."\n". 'VERSION:2.0'."\n". 'PRODID:-//Example Inc.//Example Client//EN'."\n". @@ -264,7 +264,7 @@ public function testRFC6321Example2(): void */ public function testRFC6321Section3Part2(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -282,7 +282,7 @@ public function testRFC6321Section3Part2(): void */ public function testRFC6321Section3Part3(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -327,7 +327,7 @@ public function testRFC6321Section3Part3(): void */ public function testRFC6321Section3Part4Part1Part2(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -354,7 +354,7 @@ public function testRFC6321Section3Part4Part1Part2(): void public function testRFC6321Section3Part4Part1Part3(): void { // Example 1 of RFC5545, Section 3.8.8.3. - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -375,7 +375,7 @@ public function testRFC6321Section3Part4Part1Part3(): void ); // Example 2 of RFC5545, Section 3.8.8.3. - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -397,7 +397,7 @@ public function testRFC6321Section3Part4Part1Part3(): void ); // Example 3 of RFC5545, Section 3.8.8.3. - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -420,7 +420,7 @@ public function testRFC6321Section3Part4Part1Part3(): void ); // Example 4 of RFC5545, Section 3.8.8.3. - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -441,7 +441,7 @@ public function testRFC6321Section3Part4Part1Part3(): void ); // Example 5 of RFC5545, Section 3.8.8.3. - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -468,7 +468,7 @@ public function testRFC6321Section3Part4Part1Part3(): void */ public function testRFC6321Section3Part6Part1(): void { - $this->assertXMLEqualsToMimeDir( + self::assertXMLEqualsToMimeDir( << @@ -488,7 +488,7 @@ public function testRFC6321Section3Part6Part1(): void ); // In vCard 4, BINARY no longer exists and is replaced by URI. - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -513,7 +513,7 @@ public function testRFC6321Section3Part6Part1(): void */ public function testRFC6321Section3Part6Part2(): void { - $this->assertXMLEqualsToMimeDir( + self::assertXMLEqualsToMimeDir( << @@ -541,7 +541,7 @@ public function testRFC6321Section3Part6Part2(): void */ public function testRFC6321Section3Part6Part3(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -566,7 +566,7 @@ public function testRFC6321Section3Part6Part3(): void */ public function testRFC6321Section3Part6Part4(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -591,7 +591,7 @@ public function testRFC6321Section3Part6Part4(): void */ public function testRFC6321Section3Part6Part5(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -616,7 +616,7 @@ public function testRFC6321Section3Part6Part5(): void */ public function testRFC6321Section3Part6Part6(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -650,7 +650,7 @@ public function testRFC6321Section3Part6Part7(): void */ public function testRFC6321Section3Part6Part8(): void { - $this->assertXMLEqualsToMimeDir( + self::assertXMLEqualsToMimeDir( << @@ -669,7 +669,7 @@ public function testRFC6321Section3Part6Part8(): void 'END:VCALENDAR'."\n" ); - $this->assertXMLEqualsToMimeDir( + self::assertXMLEqualsToMimeDir( << @@ -694,7 +694,7 @@ public function testRFC6321Section3Part6Part8(): void */ public function testRFC6321Section3Part6Part9(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -716,7 +716,7 @@ public function testRFC6321Section3Part6Part9(): void 'END:VCALENDAR'."\n" ); - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -744,7 +744,7 @@ public function testRFC6321Section3Part6Part9(): void */ public function testRFC6321Section3Part6Part10(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -774,7 +774,7 @@ public function testRFC6321Section3Part6Part10(): void */ public function testRFC6321Section3Part6Part11(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -799,7 +799,7 @@ public function testRFC6321Section3Part6Part11(): void */ public function testRFC6321Section3Part6Part12(): void { - $this->assertXMLEqualsToMimeDir( + self::assertXMLEqualsToMimeDir( << @@ -824,7 +824,7 @@ public function testRFC6321Section3Part6Part12(): void */ public function testRFC6321Section3Part6Part13(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -850,7 +850,7 @@ public function testRFC6321Section3Part6Part13(): void public function testRFC6321Section3Part6Part14(): void { // Example 1 of RFC5545, Section 3.3.14. - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -870,7 +870,7 @@ public function testRFC6321Section3Part6Part14(): void ); // Example 2 of RFC5545, Section 3.3.14. - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -895,7 +895,7 @@ public function testRFC6321Section3Part6Part14(): void */ public function testRFC6321Section5(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -914,7 +914,7 @@ public function testRFC6321Section5(): void 'END:VCALENDAR'."\n" ); - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -941,7 +941,7 @@ public function testRFC6321Section5(): void public function testRDateWithDateTime(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -960,7 +960,7 @@ public function testRDateWithDateTime(): void 'END:VCALENDAR'."\n" ); - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -983,7 +983,7 @@ public function testRDateWithDateTime(): void public function testRDateWithDate(): void { - $this->assertXMLEqualsToMimeDir( + self::assertXMLEqualsToMimeDir( << @@ -1002,7 +1002,7 @@ public function testRDateWithDate(): void 'END:VCALENDAR'."\n" ); - $this->assertXMLEqualsToMimeDir( + self::assertXMLEqualsToMimeDir( << @@ -1026,7 +1026,7 @@ public function testRDateWithDate(): void public function testRDateWithPeriod(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1053,7 +1053,7 @@ public function testRDateWithPeriod(): void 'END:VCALENDAR'."\n" ); - $this->assertXMLEqualsToMimeDir( + self::assertXMLEqualsToMimeDir( << @@ -1091,7 +1091,7 @@ public function testRDateWithPeriod(): void */ public function testRFC6351Basic(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1123,7 +1123,7 @@ public function testRFC6351Basic(): void */ public function testRFC6351Example1(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1167,7 +1167,7 @@ public function testRFC6351Example1(): void */ public function testRFC6351Section5(): void { - $this->assertXMLEqualsToMimeDir( + self::assertXMLEqualsToMimeDir( << @@ -1191,7 +1191,7 @@ public function testRFC6351Section5(): void 'END:VCARD'."\n" ); - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1221,7 +1221,7 @@ public function testRFC6351Section5(): void */ public function testRFC6351Section5Group(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1261,7 +1261,7 @@ public function testRFC6351Section5Group(): void */ public function testRFC6351Section5Part1NoNamespace(): void { - $this->assertXMLEqualsToMimeDir( + self::assertXMLEqualsToMimeDir( << @@ -1290,7 +1290,7 @@ public function testRFC6351Section5Part1NoNamespace(): void */ public function testRFC6351ValueDateWithYearMonthDay(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1314,7 +1314,7 @@ public function testRFC6351ValueDateWithYearMonthDay(): void */ public function testRFC6351ValueDateWithYearMonth(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1338,7 +1338,7 @@ public function testRFC6351ValueDateWithYearMonth(): void */ public function testRFC6351ValueDateWithMonth(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1362,7 +1362,7 @@ public function testRFC6351ValueDateWithMonth(): void */ public function testRFC6351ValueDateWithMonthDay(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1386,7 +1386,7 @@ public function testRFC6351ValueDateWithMonthDay(): void */ public function testRFC6351ValueDateWithDay(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1410,7 +1410,7 @@ public function testRFC6351ValueDateWithDay(): void */ public function testRFC6351ValueTimeWithHour(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1434,7 +1434,7 @@ public function testRFC6351ValueTimeWithHour(): void */ public function testRFC6351ValueTimeWithHourMinute(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1458,7 +1458,7 @@ public function testRFC6351ValueTimeWithHourMinute(): void */ public function testRFC6351ValueTimeWithHourMinuteSecond(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1482,7 +1482,7 @@ public function testRFC6351ValueTimeWithHourMinuteSecond(): void */ public function testRFC6351ValueTimeWithMinute(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1506,7 +1506,7 @@ public function testRFC6351ValueTimeWithMinute(): void */ public function testRFC6351ValueTimeWithMinuteSecond(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1530,7 +1530,7 @@ public function testRFC6351ValueTimeWithMinuteSecond(): void */ public function testRFC6351ValueTimeWithSecond(): void { - $this->assertTrue(true); + self::assertTrue(true); /* * According to the Relax NG Schema, there is a conflict between @@ -1538,7 +1538,7 @@ public function testRFC6351ValueTimeWithSecond(): void * value-date because of the higher priority set in * value-date-and-or-time. So we basically skip this test. * - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1563,7 +1563,7 @@ public function testRFC6351ValueTimeWithSecond(): void */ public function testRFC6351ValueTimeWithSecondZ(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1587,7 +1587,7 @@ public function testRFC6351ValueTimeWithSecondZ(): void */ public function testRFC6351ValueTimeWithSecondTZ(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1611,7 +1611,7 @@ public function testRFC6351ValueTimeWithSecondTZ(): void */ public function testRFC6351ValueDateTimeWithYearMonthDayHour(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1635,7 +1635,7 @@ public function testRFC6351ValueDateTimeWithYearMonthDayHour(): void */ public function testRFC6351ValueDateTimeWithMonthDayHour(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1659,7 +1659,7 @@ public function testRFC6351ValueDateTimeWithMonthDayHour(): void */ public function testRFC6351ValueDateTimeWithDayHour(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1683,7 +1683,7 @@ public function testRFC6351ValueDateTimeWithDayHour(): void */ public function testRFC6351ValueDateTimeWithDayHourMinute(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1707,7 +1707,7 @@ public function testRFC6351ValueDateTimeWithDayHourMinute(): void */ public function testRFC6351ValueDateTimeWithDayHourMinuteSecond(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1731,7 +1731,7 @@ public function testRFC6351ValueDateTimeWithDayHourMinuteSecond(): void */ public function testRFC6351ValueDateTimeWithDayHourZ(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1755,7 +1755,7 @@ public function testRFC6351ValueDateTimeWithDayHourZ(): void */ public function testRFC6351ValueDateTimeWithDayHourTZ(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1779,7 +1779,7 @@ public function testRFC6351ValueDateTimeWithDayHourTZ(): void */ public function testRFC6350Section6Part1Part3(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1803,7 +1803,7 @@ public function testRFC6350Section6Part1Part3(): void */ public function testRFC6350Section6Part1Part4(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1827,7 +1827,7 @@ public function testRFC6350Section6Part1Part4(): void */ public function testRFC6350Section6Part2Part1(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1851,7 +1851,7 @@ public function testRFC6350Section6Part2Part1(): void */ public function testRFC6350Section6Part2Part2(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1879,7 +1879,7 @@ public function testRFC6350Section6Part2Part2(): void */ public function testRFC6350Section6Part2Part3(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1904,7 +1904,7 @@ public function testRFC6350Section6Part2Part3(): void */ public function testRFC6350Section6Part2Part4(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1925,7 +1925,7 @@ public function testRFC6350Section6Part2Part4(): void public function testRFC6350Section6Part2Part5(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1946,7 +1946,7 @@ public function testRFC6350Section6Part2Part5(): void public function testRFC6350Section6Part2Part6(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1970,7 +1970,7 @@ public function testRFC6350Section6Part2Part6(): void */ public function testRFC6350Section6Part2Part7(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -1995,7 +1995,7 @@ public function testRFC6350Section6Part2Part7(): void */ public function testRFC6350Section6Part3Part1(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2035,7 +2035,7 @@ public function testRFC6350Section6Part4Part1(): void * So first, we test xCard/URI to vCard/URI. * Then, we test xCard/TEXT to vCard/TEXT to xCard/TEXT. */ - $this->assertXMLEqualsToMimeDir( + self::assertXMLEqualsToMimeDir( << @@ -2058,7 +2058,7 @@ public function testRFC6350Section6Part4Part1(): void 'END:VCARD'."\n" ); - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2087,7 +2087,7 @@ public function testRFC6350Section6Part4Part1(): void */ public function testRFC6350Section6Part4Part2(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2116,7 +2116,7 @@ public function testRFC6350Section6Part4Part2(): void */ public function testRFC6350Section6Part4Part3(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2145,7 +2145,7 @@ public function testRFC6350Section6Part4Part3(): void */ public function testRFC6350Section6Part4Part4(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2177,7 +2177,7 @@ public function testRFC6350Section6Part4Part4(): void */ public function testRFC6350Section6Part5Part1(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2201,7 +2201,7 @@ public function testRFC6350Section6Part5Part1(): void */ public function testRFC6350Section6Part5Part2(): void { - $this->assertXMLEqualsToMimeDir( + self::assertXMLEqualsToMimeDir( << @@ -2219,7 +2219,7 @@ public function testRFC6350Section6Part5Part2(): void 'END:VCARD'."\n" ); - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2243,7 +2243,7 @@ public function testRFC6350Section6Part5Part2(): void */ public function testRFC6350Section6Part6Part1(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2267,7 +2267,7 @@ public function testRFC6350Section6Part6Part1(): void */ public function testRFC6350Section6Part6Part2(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2291,7 +2291,7 @@ public function testRFC6350Section6Part6Part2(): void */ public function testRFC6350Section6Part6Part3(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2315,7 +2315,7 @@ public function testRFC6350Section6Part6Part3(): void */ public function testRFC6350Section6Part6Part4(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2341,7 +2341,7 @@ public function testRFC6350Section6Part6Part4(): void */ public function testRFC6350Section6Part6Part5(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2359,7 +2359,7 @@ public function testRFC6350Section6Part6Part5(): void 'END:VCARD'."\n" ); - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2395,7 +2395,7 @@ public function testRFC6350Section6Part6Part5(): void */ public function testRFC6350Section6Part6Part6(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2424,7 +2424,7 @@ public function testRFC6350Section6Part6Part6(): void */ public function testRFC6350Section6Part7Part1(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2451,7 +2451,7 @@ public function testRFC6350Section6Part7Part1(): void */ public function testRFC6350Section6Part7Part2(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2475,7 +2475,7 @@ public function testRFC6350Section6Part7Part2(): void */ public function testRFC6350Section6Part7Part3(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2496,7 +2496,7 @@ public function testRFC6350Section6Part7Part3(): void public function testRFC6350Section6Part7Part4(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2520,7 +2520,7 @@ public function testRFC6350Section6Part7Part4(): void */ public function testRFC6350Section6Part7Part5(): void { - $this->assertXMLEqualsToMimeDir( + self::assertXMLEqualsToMimeDir( << @@ -2538,7 +2538,7 @@ public function testRFC6350Section6Part7Part5(): void 'END:VCARD'."\n" ); - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2562,7 +2562,7 @@ public function testRFC6350Section6Part7Part5(): void */ public function testRFC6350Section6Part7Part6(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2586,7 +2586,7 @@ public function testRFC6350Section6Part7Part6(): void */ public function testRFC6350Section6Part7Part7(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2611,7 +2611,7 @@ public function testRFC6350Section6Part7Part7(): void */ public function testRFC6350Section6Part7Part8(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2635,7 +2635,7 @@ public function testRFC6350Section6Part7Part8(): void */ public function testRFC6350Section6Part7Part9(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2654,7 +2654,7 @@ public function testRFC6350Section6Part7Part9(): void */ public function testRFC6350Section6Part8Part1(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2683,7 +2683,7 @@ public function testRFC6350Section6Part8Part1(): void */ public function testRFC6350Section6Part9Part1(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2712,7 +2712,7 @@ public function testRFC6350Section6Part9Part1(): void */ public function testRFC6350Section6Part9Part2(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2736,7 +2736,7 @@ public function testRFC6350Section6Part9Part2(): void */ public function testRFC6350Section6Part9Part3(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2765,7 +2765,7 @@ public function testRFC6350Section6Part9Part3(): void */ public function testRFC6350SectionAPart3(): void { - $this->assertXMLReflexivelyEqualsToMimeDir( + self::assertXMLReflexivelyEqualsToMimeDir( << @@ -2791,7 +2791,7 @@ public function testRFC6350SectionAPart3(): void protected function assertXMLEqualsToMimeDir(string $xml, string $mimedir): void { $component = VObject\Reader::readXML($xml); - $this->assertVObjectEqualsVObject($mimedir, $component); + self::assertVObjectEqualsVObject($mimedir, $component); } /** @@ -2800,9 +2800,9 @@ protected function assertXMLEqualsToMimeDir(string $xml, string $mimedir): void */ protected function assertXMLReflexivelyEqualsToMimeDir(string $xml, string $mimedir): void { - $this->assertXMLEqualsToMimeDir($xml, $mimedir); + self::assertXMLEqualsToMimeDir($xml, $mimedir); $component = VObject\Reader::read($mimedir); - $this->assertXmlStringEqualsXmlString($xml, VObject\Writer::writeXML($component)); + self::assertXmlStringEqualsXmlString($xml, VObject\Writer::writeXML($component)); } } diff --git a/tests/VObject/Property/BooleanTest.php b/tests/VObject/Property/BooleanTest.php index ea874f17..82684dd7 100644 --- a/tests/VObject/Property/BooleanTest.php +++ b/tests/VObject/Property/BooleanTest.php @@ -15,10 +15,10 @@ public function testMimeDir(): void $input = "BEGIN:VCARD\r\nX-AWESOME;VALUE=BOOLEAN:TRUE\r\nX-SUCKS;VALUE=BOOLEAN:FALSE\r\nEND:VCARD\r\n"; $vcard = VObject\Reader::read($input); - $this->assertTrue($vcard->{'X-AWESOME'}->getValue()); - $this->assertFalse($vcard->{'X-SUCKS'}->getValue()); + self::assertTrue($vcard->{'X-AWESOME'}->getValue()); + self::assertFalse($vcard->{'X-SUCKS'}->getValue()); - $this->assertEquals('BOOLEAN', $vcard->{'X-AWESOME'}->getValueType()); - $this->assertEquals($input, $vcard->serialize()); + self::assertEquals('BOOLEAN', $vcard->{'X-AWESOME'}->getValueType()); + self::assertEquals($input, $vcard->serialize()); } } diff --git a/tests/VObject/Property/CompoundTest.php b/tests/VObject/Property/CompoundTest.php index c10ff033..073d9627 100644 --- a/tests/VObject/Property/CompoundTest.php +++ b/tests/VObject/Property/CompoundTest.php @@ -19,10 +19,10 @@ public function testSetParts(): void $elem = $vcard->createProperty('ORG'); $elem->setParts($arr); - $this->assertEquals('ABC\, Inc.;North American Division;Marketing\;Sales', $elem->getValue()); - $this->assertCount(3, $elem->getParts()); + self::assertEquals('ABC\, Inc.;North American Division;Marketing\;Sales', $elem->getValue()); + self::assertCount(3, $elem->getParts()); $parts = $elem->getParts(); - $this->assertEquals('Marketing;Sales', $parts[2]); + self::assertEquals('Marketing;Sales', $parts[2]); } public function testGetParts(): void @@ -33,9 +33,9 @@ public function testGetParts(): void $elem = $vcard->createProperty('ORG'); $elem->setRawMimeDirValue($str); - $this->assertCount(3, $elem->getParts()); + self::assertCount(3, $elem->getParts()); $parts = $elem->getParts(); - $this->assertEquals('Marketing;Sales', $parts[2]); + self::assertEquals('Marketing;Sales', $parts[2]); } public function testGetPartsNull(): void @@ -43,6 +43,6 @@ public function testGetPartsNull(): void $vcard = new VCard(); $elem = $vcard->createProperty('ORG', null); - $this->assertCount(0, $elem->getParts()); + self::assertCount(0, $elem->getParts()); } } diff --git a/tests/VObject/Property/FloatTest.php b/tests/VObject/Property/FloatTest.php index a71428a4..b5fee5d7 100644 --- a/tests/VObject/Property/FloatTest.php +++ b/tests/VObject/Property/FloatTest.php @@ -14,14 +14,14 @@ public function testMimeDir(): void $result = $mimeDir->parse($input); - $this->assertInstanceOf(FloatValue::class, $result->{'X-FLOAT'}); + self::assertInstanceOf(FloatValue::class, $result->{'X-FLOAT'}); - $this->assertEquals([ + self::assertEquals([ 0.234, 1.245, ], $result->{'X-FLOAT'}->getParts()); - $this->assertEquals( + self::assertEquals( $input, $result->serialize() ); diff --git a/tests/VObject/Property/ICalendar/CalAddressTest.php b/tests/VObject/Property/ICalendar/CalAddressTest.php index 7c9dde6d..b774f4fb 100644 --- a/tests/VObject/Property/ICalendar/CalAddressTest.php +++ b/tests/VObject/Property/ICalendar/CalAddressTest.php @@ -14,7 +14,7 @@ public function testGetNormalizedValue(string $expected, string $input): void $vobj = new \Sabre\VObject\Component\VCalendar(); $property = $vobj->add('ATTENDEE', $input); - $this->assertEquals( + self::assertEquals( $expected, $property->getNormalizedValue() ); diff --git a/tests/VObject/Property/ICalendar/DateTimeTest.php b/tests/VObject/Property/ICalendar/DateTimeTest.php index c926af80..00c8be1b 100644 --- a/tests/VObject/Property/ICalendar/DateTimeTest.php +++ b/tests/VObject/Property/ICalendar/DateTimeTest.php @@ -24,11 +24,11 @@ public function testSetDateTime(): void $elem = $this->vcal->createProperty('DTSTART'); $elem->setDateTime($dt); - $this->assertEquals('19850704T013000', (string) $elem); - $this->assertEquals('Europe/Amsterdam', (string) $elem['TZID']); - $this->assertNull($elem['VALUE']); + self::assertEquals('19850704T013000', (string) $elem); + self::assertEquals('Europe/Amsterdam', (string) $elem['TZID']); + self::assertNull($elem['VALUE']); - $this->assertTrue($elem->hasTime()); + self::assertTrue($elem->hasTime()); } public function testSetDateTimeLOCAL(): void @@ -40,10 +40,10 @@ public function testSetDateTimeLOCAL(): void $elem = $this->vcal->createProperty('DTSTART'); $elem->setDateTime($dt, true); - $this->assertEquals('19850704T013000', (string) $elem); - $this->assertNull($elem['TZID']); + self::assertEquals('19850704T013000', (string) $elem); + self::assertNull($elem['TZID']); - $this->assertTrue($elem->hasTime()); + self::assertTrue($elem->hasTime()); } public function testSetDateTimeUTC(): void @@ -55,10 +55,10 @@ public function testSetDateTimeUTC(): void $elem = $this->vcal->createProperty('DTSTART'); $elem->setDateTime($dt); - $this->assertEquals('19850704T013000Z', (string) $elem); - $this->assertNull($elem['TZID']); + self::assertEquals('19850704T013000Z', (string) $elem); + self::assertNull($elem['TZID']); - $this->assertTrue($elem->hasTime()); + self::assertTrue($elem->hasTime()); } public function testSetDateTimeFromUnixTimestamp(): void @@ -69,10 +69,10 @@ public function testSetDateTimeFromUnixTimestamp(): void $elem = $this->vcal->createProperty('DTSTART'); $elem->setDateTime($dt); - $this->assertEquals('19850704T013000Z', (string) $elem); - $this->assertNull($elem['TZID']); + self::assertEquals('19850704T013000Z', (string) $elem); + self::assertNull($elem['TZID']); - $this->assertTrue($elem->hasTime()); + self::assertTrue($elem->hasTime()); } public function testSetDateTimeLOCALTZ(): void @@ -84,10 +84,10 @@ public function testSetDateTimeLOCALTZ(): void $elem = $this->vcal->createProperty('DTSTART'); $elem->setDateTime($dt); - $this->assertEquals('19850704T013000', (string) $elem); - $this->assertEquals('Europe/Amsterdam', (string) $elem['TZID']); + self::assertEquals('19850704T013000', (string) $elem); + self::assertEquals('Europe/Amsterdam', (string) $elem['TZID']); - $this->assertTrue($elem->hasTime()); + self::assertTrue($elem->hasTime()); } public function testSetDateTimeDATE(): void @@ -100,11 +100,11 @@ public function testSetDateTimeDATE(): void $elem['VALUE'] = 'DATE'; $elem->setDateTime($dt); - $this->assertEquals('19850704', (string) $elem); - $this->assertNull($elem['TZID']); - $this->assertEquals('DATE', (string) $elem['VALUE']); + self::assertEquals('19850704', (string) $elem); + self::assertNull($elem['TZID']); + self::assertEquals('DATE', (string) $elem['VALUE']); - $this->assertFalse($elem->hasTime()); + self::assertFalse($elem->hasTime()); } public function testSetValue(): void @@ -116,11 +116,11 @@ public function testSetValue(): void $elem = $this->vcal->createProperty('DTSTART'); $elem->setValue($dt); - $this->assertEquals('19850704T013000', (string) $elem); - $this->assertEquals('Europe/Amsterdam', (string) $elem['TZID']); - $this->assertNull($elem['VALUE']); + self::assertEquals('19850704T013000', (string) $elem); + self::assertEquals('Europe/Amsterdam', (string) $elem['TZID']); + self::assertNull($elem['VALUE']); - $this->assertTrue($elem->hasTime()); + self::assertTrue($elem->hasTime()); } public function testSetValueArray(): void @@ -134,11 +134,11 @@ public function testSetValueArray(): void $elem = $this->vcal->createProperty('DTSTART'); $elem->setValue([$dt1, $dt2]); - $this->assertEquals('19850704T013000,19850704T023000', (string) $elem); - $this->assertEquals('Europe/Amsterdam', (string) $elem['TZID']); - $this->assertNull($elem['VALUE']); + self::assertEquals('19850704T013000,19850704T023000', (string) $elem); + self::assertEquals('Europe/Amsterdam', (string) $elem['TZID']); + self::assertNull($elem['VALUE']); - $this->assertTrue($elem->hasTime()); + self::assertTrue($elem->hasTime()); } public function testSetParts(): void @@ -152,11 +152,11 @@ public function testSetParts(): void $elem = $this->vcal->createProperty('DTSTART'); $elem->setParts([$dt1, $dt2]); - $this->assertEquals('19850704T013000,19850704T023000', (string) $elem); - $this->assertEquals('Europe/Amsterdam', (string) $elem['TZID']); - $this->assertNull($elem['VALUE']); + self::assertEquals('19850704T013000,19850704T023000', (string) $elem); + self::assertEquals('Europe/Amsterdam', (string) $elem['TZID']); + self::assertNull($elem['VALUE']); - $this->assertTrue($elem->hasTime()); + self::assertTrue($elem->hasTime()); } public function testSetPartsStrings(): void @@ -167,10 +167,10 @@ public function testSetPartsStrings(): void $elem = $this->vcal->createProperty('DTSTART'); $elem->setParts([$dt1, $dt2]); - $this->assertEquals('19850704T013000Z,19850704T023000Z', (string) $elem); - $this->assertNull($elem['VALUE']); + self::assertEquals('19850704T013000Z,19850704T023000Z', (string) $elem); + self::assertNull($elem['VALUE']); - $this->assertTrue($elem->hasTime()); + self::assertTrue($elem->hasTime()); } public function testGetDateTimeCached(): void @@ -182,7 +182,7 @@ public function testGetDateTimeCached(): void $elem = $this->vcal->createProperty('DTSTART'); $elem->setDateTime($dt); - $this->assertEquals($elem->getDateTime(), $dt); + self::assertEquals($elem->getDateTime(), $dt); } public function testGetDateTimeDateNULL(): void @@ -190,7 +190,7 @@ public function testGetDateTimeDateNULL(): void $elem = $this->vcal->createProperty('DTSTART'); $dt = $elem->getDateTime(); - $this->assertNull($dt); + self::assertNull($dt); } public function testGetDateTimeDateDATE(): void @@ -198,8 +198,8 @@ public function testGetDateTimeDateDATE(): void $elem = $this->vcal->createProperty('DTSTART', '19850704'); $dt = $elem->getDateTime(); - $this->assertInstanceOf('DateTimeImmutable', $dt); - $this->assertEquals('1985-07-04 00:00:00', $dt->format('Y-m-d H:i:s')); + self::assertInstanceOf('DateTimeImmutable', $dt); + self::assertEquals('1985-07-04 00:00:00', $dt->format('Y-m-d H:i:s')); } public function testGetDateTimeDateDATEReferenceTimeZone(): void @@ -210,8 +210,8 @@ public function testGetDateTimeDateDATEReferenceTimeZone(): void $dt = $elem->getDateTime($tz); $dt = $dt->setTimeZone(new \DateTimeZone('UTC')); - $this->assertInstanceOf('DateTimeImmutable', $dt); - $this->assertEquals('1985-07-04 04:00:00', $dt->format('Y-m-d H:i:s')); + self::assertInstanceOf('DateTimeImmutable', $dt); + self::assertEquals('1985-07-04 04:00:00', $dt->format('Y-m-d H:i:s')); } public function testGetDateTimeDateFloating(): void @@ -219,8 +219,8 @@ public function testGetDateTimeDateFloating(): void $elem = $this->vcal->createProperty('DTSTART', '19850704T013000'); $dt = $elem->getDateTime(); - $this->assertInstanceOf('DateTimeImmutable', $dt); - $this->assertEquals('1985-07-04 01:30:00', $dt->format('Y-m-d H:i:s')); + self::assertInstanceOf('DateTimeImmutable', $dt); + self::assertEquals('1985-07-04 01:30:00', $dt->format('Y-m-d H:i:s')); } public function testGetDateTimeDateFloatingReferenceTimeZone(): void @@ -231,8 +231,8 @@ public function testGetDateTimeDateFloatingReferenceTimeZone(): void $dt = $elem->getDateTime($tz); $dt = $dt->setTimeZone(new \DateTimeZone('UTC')); - $this->assertInstanceOf('DateTimeInterface', $dt); - $this->assertEquals('1985-07-04 05:30:00', $dt->format('Y-m-d H:i:s')); + self::assertInstanceOf('DateTimeInterface', $dt); + self::assertEquals('1985-07-04 05:30:00', $dt->format('Y-m-d H:i:s')); } public function testGetDateTimeDateUTC(): void @@ -240,9 +240,9 @@ public function testGetDateTimeDateUTC(): void $elem = $this->vcal->createProperty('DTSTART', '19850704T013000Z'); $dt = $elem->getDateTime(); - $this->assertInstanceOf('DateTimeImmutable', $dt); - $this->assertEquals('1985-07-04 01:30:00', $dt->format('Y-m-d H:i:s')); - $this->assertEquals('UTC', $dt->getTimeZone()->getName()); + self::assertInstanceOf('DateTimeImmutable', $dt); + self::assertEquals('1985-07-04 01:30:00', $dt->format('Y-m-d H:i:s')); + self::assertEquals('UTC', $dt->getTimeZone()->getName()); } public function testGetDateTimeDateLOCALTZ(): void @@ -252,9 +252,9 @@ public function testGetDateTimeDateLOCALTZ(): void $dt = $elem->getDateTime(); - $this->assertInstanceOf('DateTimeImmutable', $dt); - $this->assertEquals('1985-07-04 01:30:00', $dt->format('Y-m-d H:i:s')); - $this->assertEquals('Europe/Amsterdam', $dt->getTimeZone()->getName()); + self::assertInstanceOf('DateTimeImmutable', $dt); + self::assertEquals('1985-07-04 01:30:00', $dt->format('Y-m-d H:i:s')); + self::assertEquals('Europe/Amsterdam', $dt->getTimeZone()->getName()); } public function testGetDateTimeDateInvalid(): void @@ -281,9 +281,9 @@ public function testGetDateTimeWeirdTZ(): void $dt = $elem->getDateTime(); - $this->assertInstanceOf('DateTimeImmutable', $dt); - $this->assertEquals('1985-07-04 01:30:00', $dt->format('Y-m-d H:i:s')); - $this->assertEquals('Europe/Amsterdam', $dt->getTimeZone()->getName()); + self::assertInstanceOf('DateTimeImmutable', $dt); + self::assertEquals('1985-07-04 01:30:00', $dt->format('Y-m-d H:i:s')); + self::assertEquals('Europe/Amsterdam', $dt->getTimeZone()->getName()); } public function testGetDateTimeBadTimeZone(): void @@ -306,9 +306,9 @@ public function testGetDateTimeBadTimeZone(): void $dt = $elem->getDateTime(); - $this->assertInstanceOf('DateTimeImmutable', $dt); - $this->assertEquals('1985-07-04 01:30:00', $dt->format('Y-m-d H:i:s')); - $this->assertEquals('Canada/Eastern', $dt->getTimeZone()->getName()); + self::assertInstanceOf('DateTimeImmutable', $dt); + self::assertEquals('1985-07-04 01:30:00', $dt->format('Y-m-d H:i:s')); + self::assertEquals('Canada/Eastern', $dt->getTimeZone()->getName()); date_default_timezone_set($default); } @@ -317,15 +317,15 @@ public function testUpdateValueParameter(): void $dtStart = $this->vcal->createProperty('DTSTART', new \DateTime('2013-06-07 15:05:00')); $dtStart['VALUE'] = 'DATE'; - $this->assertEquals("DTSTART;VALUE=DATE:20130607\r\n", $dtStart->serialize()); + self::assertEquals("DTSTART;VALUE=DATE:20130607\r\n", $dtStart->serialize()); } public function testValidate(): void { $exDate = $this->vcal->createProperty('EXDATE', '-00011130T143000Z'); $messages = $exDate->validate(); - $this->assertCount(1, $messages); - $this->assertEquals(3, $messages[0]['level']); + self::assertCount(1, $messages); + self::assertEquals(3, $messages[0]['level']); } /** @@ -342,6 +342,6 @@ public function testCreateDatePropertyThroughAdd(): void ['VALUE' => 'DATE'] ); - $this->assertEquals("DTSTART;VALUE=DATE:20140307\r\n", $dtstart->serialize()); + self::assertEquals("DTSTART;VALUE=DATE:20140307\r\n", $dtstart->serialize()); } } diff --git a/tests/VObject/Property/ICalendar/DurationTest.php b/tests/VObject/Property/ICalendar/DurationTest.php index 5c90cfb1..044f8627 100644 --- a/tests/VObject/Property/ICalendar/DurationTest.php +++ b/tests/VObject/Property/ICalendar/DurationTest.php @@ -12,7 +12,7 @@ public function testGetDateInterval(): void $vcal = new VCalendar(); $event = $vcal->add('VEVENT', ['DURATION' => ['PT1H']]); - $this->assertEquals( + self::assertEquals( new \DateInterval('PT1H'), $event->{'DURATION'}->getDateInterval() ); diff --git a/tests/VObject/Property/ICalendar/RecurTest.php b/tests/VObject/Property/ICalendar/RecurTest.php index e0cce696..b2750f03 100644 --- a/tests/VObject/Property/ICalendar/RecurTest.php +++ b/tests/VObject/Property/ICalendar/RecurTest.php @@ -16,12 +16,12 @@ public function testParts(): void $vcal = new VCalendar(); $recur = $vcal->add('RRULE', 'FREQ=Daily'); - $this->assertInstanceOf(Recur::class, $recur); + self::assertInstanceOf(Recur::class, $recur); - $this->assertEquals(['FREQ' => 'DAILY'], $recur->getParts()); + self::assertEquals(['FREQ' => 'DAILY'], $recur->getParts()); $recur->setParts(['freq' => 'MONTHLY']); - $this->assertEquals(['FREQ' => 'MONTHLY'], $recur->getParts()); + self::assertEquals(['FREQ' => 'MONTHLY'], $recur->getParts()); } public function testSetValueBadVal(): void @@ -37,7 +37,7 @@ public function testSetValueWithCount(): void $vcal = new VCalendar(); $recur = $vcal->add('RRULE', 'FREQ=Daily'); $recur->setValue(['COUNT' => 3]); - $this->assertEquals(3, $recur->getParts()['COUNT']); + self::assertEquals(3, $recur->getParts()['COUNT']); } public function testGetJSONWithCount(): void @@ -58,8 +58,8 @@ public function testGetJSONWithCount(): void $vcal = Reader::read($input); $rrule = $vcal->VEVENT->RRULE; $count = $rrule->getJsonValue()[0]['count']; - $this->assertTrue(is_int($count)); - $this->assertEquals(3, $count); + self::assertTrue(is_int($count)); + self::assertEquals(3, $count); } public function testSetSubParts(): void @@ -67,7 +67,7 @@ public function testSetSubParts(): void $vcal = new VCalendar(); $recur = $vcal->add('RRULE', ['FREQ' => 'DAILY', 'BYDAY' => 'mo,tu', 'BYMONTH' => [0, 1]]); - $this->assertEquals([ + self::assertEquals([ 'FREQ' => 'DAILY', 'BYDAY' => ['MO', 'TU'], 'BYMONTH' => [0, 1], @@ -92,7 +92,7 @@ public function testGetJSONWithUntil(): void $vcal = Reader::read($input); $rrule = $vcal->VEVENT->RRULE; $untilJsonString = $rrule->getJsonValue()[0]['until']; - $this->assertEquals('2016-03-05T23:00:00Z', $untilJsonString); + self::assertEquals('2016-03-05T23:00:00Z', $untilJsonString); } public function testValidateStripEmpties(): void @@ -114,11 +114,11 @@ public function testValidateStripEmpties(): void '; $vcal = Reader::read($input); - $this->assertCount( + self::assertCount( 1, $vcal->validate() ); - $this->assertCount( + self::assertCount( 1, $vcal->validate($vcal::REPAIR) ); @@ -139,7 +139,7 @@ public function testValidateStripEmpties(): void END:VCALENDAR '; - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $expected, $vcal ); @@ -164,11 +164,11 @@ public function testValidateStripNoFreq(): void '; $vcal = Reader::read($input); - $this->assertCount( + self::assertCount( 1, $vcal->validate() ); - $this->assertCount( + self::assertCount( 1, $vcal->validate($vcal::REPAIR) ); @@ -188,7 +188,7 @@ public function testValidateStripNoFreq(): void END:VCALENDAR '; - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $expected, $vcal ); @@ -200,10 +200,10 @@ public function testValidateInvalidByMonthRruleWithRepair(): void $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=0'); $result = $property->validate(Node::REPAIR); - $this->assertCount(1, $result); - $this->assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[0]['message']); - $this->assertEquals(1, $result[0]['level']); - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYMONTHDAY=24', $property->getValue()); + self::assertCount(1, $result); + self::assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[0]['message']); + self::assertEquals(1, $result[0]['level']); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYMONTHDAY=24', $property->getValue()); } public function testValidateInvalidByMonthRruleWithoutRepair(): void @@ -212,10 +212,10 @@ public function testValidateInvalidByMonthRruleWithoutRepair(): void $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=0'); $result = $property->validate(); - $this->assertCount(1, $result); - $this->assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[0]['message']); - $this->assertEquals(3, $result[0]['level']); - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=0', $property->getValue()); + self::assertCount(1, $result); + self::assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[0]['message']); + self::assertEquals(3, $result[0]['level']); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=0', $property->getValue()); } public function testValidateInvalidByMonthRruleWithRepair2(): void @@ -224,10 +224,10 @@ public function testValidateInvalidByMonthRruleWithRepair2(): void $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=bla'); $result = $property->validate(Node::REPAIR); - $this->assertCount(1, $result); - $this->assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[0]['message']); - $this->assertEquals(1, $result[0]['level']); - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYMONTHDAY=24', $property->getValue()); + self::assertCount(1, $result); + self::assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[0]['message']); + self::assertEquals(1, $result[0]['level']); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYMONTHDAY=24', $property->getValue()); } public function testValidateInvalidByMonthRruleWithoutRepair2(): void @@ -236,11 +236,11 @@ public function testValidateInvalidByMonthRruleWithoutRepair2(): void $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=bla'); $result = $property->validate(); - $this->assertCount(1, $result); - $this->assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[0]['message']); - $this->assertEquals(3, $result[0]['level']); + self::assertCount(1, $result); + self::assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[0]['message']); + self::assertEquals(3, $result[0]['level']); // Without repair the invalid BYMONTH is still there, but the value is changed to uppercase - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=BLA', $property->getValue()); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=BLA', $property->getValue()); } public function testValidateInvalidByMonthRruleValue14WithRepair(): void @@ -249,10 +249,10 @@ public function testValidateInvalidByMonthRruleValue14WithRepair(): void $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=14'); $result = $property->validate(Node::REPAIR); - $this->assertCount(1, $result); - $this->assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[0]['message']); - $this->assertEquals(1, $result[0]['level']); - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYMONTHDAY=24', $property->getValue()); + self::assertCount(1, $result); + self::assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[0]['message']); + self::assertEquals(1, $result[0]['level']); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYMONTHDAY=24', $property->getValue()); } public function testValidateInvalidByMonthRruleMultipleWithRepair(): void @@ -261,12 +261,12 @@ public function testValidateInvalidByMonthRruleMultipleWithRepair(): void $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=0,1,2,3,4,14'); $result = $property->validate(Node::REPAIR); - $this->assertCount(2, $result); - $this->assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[0]['message']); - $this->assertEquals(1, $result[0]['level']); - $this->assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[1]['message']); - $this->assertEquals(1, $result[1]['level']); - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=1,2,3,4', $property->getValue()); + self::assertCount(2, $result); + self::assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[0]['message']); + self::assertEquals(1, $result[0]['level']); + self::assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[1]['message']); + self::assertEquals(1, $result[1]['level']); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=1,2,3,4', $property->getValue()); } public function testValidateOneOfManyInvalidByMonthRruleWithRepair(): void @@ -275,19 +275,19 @@ public function testValidateOneOfManyInvalidByMonthRruleWithRepair(): void $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=bla,3,foo'); $result = $property->validate(Node::REPAIR); - $this->assertCount(2, $result); - $this->assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[0]['message']); - $this->assertEquals(1, $result[0]['level']); - $this->assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[1]['message']); - $this->assertEquals(1, $result[1]['level']); - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=3', $property->getValue()); + self::assertCount(2, $result); + self::assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[0]['message']); + self::assertEquals(1, $result[0]['level']); + self::assertEquals('BYMONTH in RRULE must have value(s) between 1 and 12!', $result[1]['message']); + self::assertEquals(1, $result[1]['level']); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=3', $property->getValue()); } public function testValidateValidByMonthRrule(): void { $calendar = new VCalendar(); $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=2,3'); - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=2,3', $property->getValue()); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYMONTHDAY=24;BYMONTH=2,3', $property->getValue()); } /** @@ -300,8 +300,8 @@ public function testValidateRruleBySecondZero(): void $result = $property->validate(Node::REPAIR); // There should be 0 warnings and the value should be unchanged - $this->assertEmpty($result); - $this->assertEquals('FREQ=DAILY;BYHOUR=10;BYMINUTE=30;BYSECOND=0;UNTIL=20150616T153000Z', $property->getValue()); + self::assertEmpty($result); + self::assertEquals('FREQ=DAILY;BYHOUR=10;BYMINUTE=30;BYSECOND=0;UNTIL=20150616T153000Z', $property->getValue()); } public function testValidateValidByWeekNoWithRepair(): void @@ -310,8 +310,8 @@ public function testValidateValidByWeekNoWithRepair(): void $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYWEEKNO=11'); $result = $property->validate(Node::REPAIR); - $this->assertCount(0, $result); - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYWEEKNO=11', $property->getValue()); + self::assertCount(0, $result); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYWEEKNO=11', $property->getValue()); } public function testValidateInvalidByWeekNoWithRepair(): void @@ -320,10 +320,10 @@ public function testValidateInvalidByWeekNoWithRepair(): void $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYWEEKNO=55;BYDAY=WE'); $result = $property->validate(Node::REPAIR); - $this->assertCount(1, $result); - $this->assertEquals('BYWEEKNO in RRULE must have value(s) from -53 to -1, or 1 to 53!', $result[0]['message']); - $this->assertEquals(1, $result[0]['level']); - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYDAY=WE', $property->getValue()); + self::assertCount(1, $result); + self::assertEquals('BYWEEKNO in RRULE must have value(s) from -53 to -1, or 1 to 53!', $result[0]['message']); + self::assertEquals(1, $result[0]['level']); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYDAY=WE', $property->getValue()); } public function testValidateMultipleInvalidByWeekNoWithRepair(): void @@ -332,12 +332,12 @@ public function testValidateMultipleInvalidByWeekNoWithRepair(): void $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYWEEKNO=55,2,-80;BYDAY=WE'); $result = $property->validate(Node::REPAIR); - $this->assertCount(2, $result); - $this->assertEquals('BYWEEKNO in RRULE must have value(s) from -53 to -1, or 1 to 53!', $result[0]['message']); - $this->assertEquals(1, $result[0]['level']); - $this->assertEquals('BYWEEKNO in RRULE must have value(s) from -53 to -1, or 1 to 53!', $result[1]['message']); - $this->assertEquals(1, $result[1]['level']); - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYWEEKNO=2;BYDAY=WE', $property->getValue()); + self::assertCount(2, $result); + self::assertEquals('BYWEEKNO in RRULE must have value(s) from -53 to -1, or 1 to 53!', $result[0]['message']); + self::assertEquals(1, $result[0]['level']); + self::assertEquals('BYWEEKNO in RRULE must have value(s) from -53 to -1, or 1 to 53!', $result[1]['message']); + self::assertEquals(1, $result[1]['level']); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYWEEKNO=2;BYDAY=WE', $property->getValue()); } public function testValidateAllInvalidByWeekNoWithRepair(): void @@ -346,12 +346,12 @@ public function testValidateAllInvalidByWeekNoWithRepair(): void $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYWEEKNO=55,-80;BYDAY=WE'); $result = $property->validate(Node::REPAIR); - $this->assertCount(2, $result); - $this->assertEquals('BYWEEKNO in RRULE must have value(s) from -53 to -1, or 1 to 53!', $result[0]['message']); - $this->assertEquals(1, $result[0]['level']); - $this->assertEquals('BYWEEKNO in RRULE must have value(s) from -53 to -1, or 1 to 53!', $result[1]['message']); - $this->assertEquals(1, $result[1]['level']); - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYDAY=WE', $property->getValue()); + self::assertCount(2, $result); + self::assertEquals('BYWEEKNO in RRULE must have value(s) from -53 to -1, or 1 to 53!', $result[0]['message']); + self::assertEquals(1, $result[0]['level']); + self::assertEquals('BYWEEKNO in RRULE must have value(s) from -53 to -1, or 1 to 53!', $result[1]['message']); + self::assertEquals(1, $result[1]['level']); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYDAY=WE', $property->getValue()); } public function testValidateInvalidByWeekNoWithoutRepair(): void @@ -360,10 +360,10 @@ public function testValidateInvalidByWeekNoWithoutRepair(): void $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYWEEKNO=55;BYDAY=WE'); $result = $property->validate(); - $this->assertCount(1, $result); - $this->assertEquals('BYWEEKNO in RRULE must have value(s) from -53 to -1, or 1 to 53!', $result[0]['message']); - $this->assertEquals(3, $result[0]['level']); - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYWEEKNO=55;BYDAY=WE', $property->getValue()); + self::assertCount(1, $result); + self::assertEquals('BYWEEKNO in RRULE must have value(s) from -53 to -1, or 1 to 53!', $result[0]['message']); + self::assertEquals(3, $result[0]['level']); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYWEEKNO=55;BYDAY=WE', $property->getValue()); } public function testValidateValidByYearDayWithRepair(): void @@ -372,8 +372,8 @@ public function testValidateValidByYearDayWithRepair(): void $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYYEARDAY=119'); $result = $property->validate(Node::REPAIR); - $this->assertCount(0, $result); - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYYEARDAY=119', $property->getValue()); + self::assertCount(0, $result); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYYEARDAY=119', $property->getValue()); } public function testValidateInvalidByYearDayWithRepair(): void @@ -382,10 +382,10 @@ public function testValidateInvalidByYearDayWithRepair(): void $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYYEARDAY=367;BYDAY=WE'); $result = $property->validate(Node::REPAIR); - $this->assertCount(1, $result); - $this->assertEquals('BYYEARDAY in RRULE must have value(s) from -366 to -1, or 1 to 366!', $result[0]['message']); - $this->assertEquals(1, $result[0]['level']); - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYDAY=WE', $property->getValue()); + self::assertCount(1, $result); + self::assertEquals('BYYEARDAY in RRULE must have value(s) from -366 to -1, or 1 to 366!', $result[0]['message']); + self::assertEquals(1, $result[0]['level']); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYDAY=WE', $property->getValue()); } public function testValidateMultipleInvalidByYearDayWithRepair(): void @@ -394,12 +394,12 @@ public function testValidateMultipleInvalidByYearDayWithRepair(): void $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYYEARDAY=380,2,-390;BYDAY=WE'); $result = $property->validate(Node::REPAIR); - $this->assertCount(2, $result); - $this->assertEquals('BYYEARDAY in RRULE must have value(s) from -366 to -1, or 1 to 366!', $result[0]['message']); - $this->assertEquals(1, $result[0]['level']); - $this->assertEquals('BYYEARDAY in RRULE must have value(s) from -366 to -1, or 1 to 366!', $result[1]['message']); - $this->assertEquals(1, $result[1]['level']); - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYYEARDAY=2;BYDAY=WE', $property->getValue()); + self::assertCount(2, $result); + self::assertEquals('BYYEARDAY in RRULE must have value(s) from -366 to -1, or 1 to 366!', $result[0]['message']); + self::assertEquals(1, $result[0]['level']); + self::assertEquals('BYYEARDAY in RRULE must have value(s) from -366 to -1, or 1 to 366!', $result[1]['message']); + self::assertEquals(1, $result[1]['level']); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYYEARDAY=2;BYDAY=WE', $property->getValue()); } public function testValidateAllInvalidByYearDayWithRepair(): void @@ -408,12 +408,12 @@ public function testValidateAllInvalidByYearDayWithRepair(): void $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYYEARDAY=455,-480;BYDAY=WE'); $result = $property->validate(Node::REPAIR); - $this->assertCount(2, $result); - $this->assertEquals('BYYEARDAY in RRULE must have value(s) from -366 to -1, or 1 to 366!', $result[0]['message']); - $this->assertEquals(1, $result[0]['level']); - $this->assertEquals('BYYEARDAY in RRULE must have value(s) from -366 to -1, or 1 to 366!', $result[1]['message']); - $this->assertEquals(1, $result[1]['level']); - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYDAY=WE', $property->getValue()); + self::assertCount(2, $result); + self::assertEquals('BYYEARDAY in RRULE must have value(s) from -366 to -1, or 1 to 366!', $result[0]['message']); + self::assertEquals(1, $result[0]['level']); + self::assertEquals('BYYEARDAY in RRULE must have value(s) from -366 to -1, or 1 to 366!', $result[1]['message']); + self::assertEquals(1, $result[1]['level']); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYDAY=WE', $property->getValue()); } public function testValidateInvalidByYearDayWithoutRepair(): void @@ -422,9 +422,9 @@ public function testValidateInvalidByYearDayWithoutRepair(): void $property = $calendar->createProperty('RRULE', 'FREQ=YEARLY;COUNT=6;BYYEARDAY=380;BYDAY=WE'); $result = $property->validate(); - $this->assertCount(1, $result); - $this->assertEquals('BYYEARDAY in RRULE must have value(s) from -366 to -1, or 1 to 366!', $result[0]['message']); - $this->assertEquals(3, $result[0]['level']); - $this->assertEquals('FREQ=YEARLY;COUNT=6;BYYEARDAY=380;BYDAY=WE', $property->getValue()); + self::assertCount(1, $result); + self::assertEquals('BYYEARDAY in RRULE must have value(s) from -366 to -1, or 1 to 366!', $result[0]['message']); + self::assertEquals(3, $result[0]['level']); + self::assertEquals('FREQ=YEARLY;COUNT=6;BYYEARDAY=380;BYDAY=WE', $property->getValue()); } } diff --git a/tests/VObject/Property/TextTest.php b/tests/VObject/Property/TextTest.php index 98489415..0fa320bf 100644 --- a/tests/VObject/Property/TextTest.php +++ b/tests/VObject/Property/TextTest.php @@ -21,12 +21,12 @@ public function assertVCard21Serialization($propValue, string $expected): void $output = $doc->serialize(); - $this->assertEquals("BEGIN:VCARD\r\nVERSION:2.1\r\n$expected\r\nEND:VCARD\r\n", $output); + self::assertEquals("BEGIN:VCARD\r\nVERSION:2.1\r\n$expected\r\nEND:VCARD\r\n", $output); } public function testSerializeVCard21(): void { - $this->assertVCard21Serialization( + self::assertVCard21Serialization( 'f;oo', 'PROP;P1=V1:f;oo' ); @@ -34,7 +34,7 @@ public function testSerializeVCard21(): void public function testSerializeVCard21Array(): void { - $this->assertVCard21Serialization( + self::assertVCard21Serialization( ['f;oo', 'bar'], 'PROP;P1=V1:f\;oo;bar' ); @@ -42,7 +42,7 @@ public function testSerializeVCard21Array(): void public function testSerializeVCard21Fold(): void { - $this->assertVCard21Serialization( + self::assertVCard21Serialization( str_repeat('x', 80), 'PROP;P1=V1:'.str_repeat('x', 64)."\r\n ".str_repeat('x', 16) ); @@ -50,7 +50,7 @@ public function testSerializeVCard21Fold(): void public function testSerializeQuotedPrintable(): void { - $this->assertVCard21Serialization( + self::assertVCard21Serialization( "foo\r\nbar", 'PROP;P1=V1;ENCODING=QUOTED-PRINTABLE:foo=0D=0Abar' ); @@ -58,7 +58,7 @@ public function testSerializeQuotedPrintable(): void public function testSerializeQuotedPrintableFold(): void { - $this->assertVCard21Serialization( + self::assertVCard21Serialization( "foo\r\nbarxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "PROP;P1=V1;ENCODING=QUOTED-PRINTABLE:foo=0D=0Abarxxxxxxxxxxxxxxxxxxxxxxxxxx=\r\n xxx" ); @@ -76,12 +76,12 @@ public function testValidateMinimumPropValue(): void IN; $vcard = \Sabre\VObject\Reader::read($vcard); - $this->assertCount(1, $vcard->validate()); + self::assertCount(1, $vcard->validate()); - $this->assertCount(1, $vcard->N->getParts()); + self::assertCount(1, $vcard->N->getParts()); $vcard->validate(\Sabre\VObject\Node::REPAIR); - $this->assertCount(5, $vcard->N->getParts()); + self::assertCount(5, $vcard->N->getParts()); } } diff --git a/tests/VObject/Property/UriTest.php b/tests/VObject/Property/UriTest.php index 80810104..edb7cc39 100644 --- a/tests/VObject/Property/UriTest.php +++ b/tests/VObject/Property/UriTest.php @@ -21,6 +21,6 @@ public function testAlwaysEncodeUriVCalendar(): void END:VCALENDAR ICS; $output = Reader::read($input)->serialize(); - $this->assertStringContainsString('URL;VALUE=URI:http://example.org/', $output); + self::assertStringContainsString('URL;VALUE=URI:http://example.org/', $output); } } diff --git a/tests/VObject/Property/VCard/DateAndOrTimeTest.php b/tests/VObject/Property/VCard/DateAndOrTimeTest.php index 9aefefb9..8e2cb320 100644 --- a/tests/VObject/Property/VCard/DateAndOrTimeTest.php +++ b/tests/VObject/Property/VCard/DateAndOrTimeTest.php @@ -16,7 +16,7 @@ public function testGetJsonValue(string $input, string $output): void $vcard = new VObject\Component\VCard(); $prop = $vcard->createProperty('BDAY', $input); - $this->assertEquals([$output], $prop->getJsonValue()); + self::assertEquals([$output], $prop->getJsonValue()); } public function dates(): array @@ -90,7 +90,7 @@ public function testSetParts(): void new \DateTime('2014-04-02 18:37:00'), ]); - $this->assertEquals('20140402T183700Z', $prop->getValue()); + self::assertEquals('20140402T183700Z', $prop->getValue()); } public function testSetPartsDateTimeImmutable(): void @@ -102,7 +102,7 @@ public function testSetPartsDateTimeImmutable(): void new \DateTimeImmutable('2014-04-02 18:37:00'), ]); - $this->assertEquals('20140402T183700Z', $prop->getValue()); + self::assertEquals('20140402T183700Z', $prop->getValue()); } public function testSetPartsTooMany(): void @@ -126,7 +126,7 @@ public function testSetPartsString(): void '20140402T183700Z', ]); - $this->assertEquals('20140402T183700Z', $prop->getValue()); + self::assertEquals('20140402T183700Z', $prop->getValue()); } public function testSetValueDateTime(): void @@ -138,7 +138,7 @@ public function testSetValueDateTime(): void new \DateTime('2014-04-02 18:37:00') ); - $this->assertEquals('20140402T183700Z', $prop->getValue()); + self::assertEquals('20140402T183700Z', $prop->getValue()); } public function testSetValueDateTimeImmutable(): void @@ -150,7 +150,7 @@ public function testSetValueDateTimeImmutable(): void new \DateTimeImmutable('2014-04-02 18:37:00') ); - $this->assertEquals('20140402T183700Z', $prop->getValue()); + self::assertEquals('20140402T183700Z', $prop->getValue()); } public function testSetDateTimeOffset(): void @@ -162,7 +162,7 @@ public function testSetDateTimeOffset(): void new \DateTime('2014-04-02 18:37:00', new \DateTimeZone('America/Toronto')) ); - $this->assertEquals('20140402T183700-0400', $prop->getValue()); + self::assertEquals('20140402T183700-0400', $prop->getValue()); } public function testGetDateTime(): void @@ -173,7 +173,7 @@ public function testGetDateTime(): void $prop = $vcard->createProperty('BDAY', $datetime); $dt = $prop->getDateTime(); - $this->assertEquals('2014-04-02T18:37:00-04:00', $dt->format('c'), 'For some reason this one failed. Current default timezone is: '.date_default_timezone_get()); + self::assertEquals('2014-04-02T18:37:00-04:00', $dt->format('c'), 'For some reason this one failed. Current default timezone is: '.date_default_timezone_get()); } public function testGetDate(): void @@ -183,8 +183,8 @@ public function testGetDate(): void $vcard = new VObject\Component\VCard(); $prop = $vcard->createProperty('BDAY', $datetime, null, 'DATE'); - $this->assertEquals('DATE', $prop->getValueType()); - $this->assertEquals('BDAY:20140402', rtrim($prop->serialize())); + self::assertEquals('DATE', $prop->getValueType()); + self::assertEquals('BDAY:20140402', rtrim($prop->serialize())); } public function testGetDateIncomplete(): void @@ -202,7 +202,7 @@ public function testGetDateIncomplete(): void $current = new \DateTime('now'); $year = $current->format('Y'); - $this->assertEquals($year.'0407', $dt->format('Ymd')); + self::assertEquals($year.'0407', $dt->format('Ymd')); } public function testGetDateIncompleteFromVCard(): void @@ -224,7 +224,7 @@ public function testGetDateIncompleteFromVCard(): void $current = new \DateTime('now'); $year = $current->format('Y'); - $this->assertEquals($year.'0407', $dt->format('Ymd')); + self::assertEquals($year.'0407', $dt->format('Ymd')); } public function testValidate(): void @@ -234,7 +234,7 @@ public function testValidate(): void $vcard = new VObject\Component\VCard(); $prop = $vcard->add('BDAY', $datetime); - $this->assertEquals([], $prop->validate()); + self::assertEquals([], $prop->validate()); } public function testValidateBroken(): void @@ -244,7 +244,7 @@ public function testValidateBroken(): void $vcard = new VObject\Component\VCard(); $prop = $vcard->add('BDAY', $datetime); - $this->assertEquals([[ + self::assertEquals([[ 'level' => 3, 'message' => 'The supplied value (123) is not a correct DATE-AND-OR-TIME property', 'node' => $prop, diff --git a/tests/VObject/Property/VCard/LanguageTagTest.php b/tests/VObject/Property/VCard/LanguageTagTest.php index 98a98908..be3d5c62 100644 --- a/tests/VObject/Property/VCard/LanguageTagTest.php +++ b/tests/VObject/Property/VCard/LanguageTagTest.php @@ -14,11 +14,11 @@ public function testMimeDir(): void $result = $mimeDir->parse($input); - $this->assertInstanceOf(LanguageTag::class, $result->LANG); + self::assertInstanceOf(LanguageTag::class, $result->LANG); - $this->assertEquals('nl', $result->LANG->getValue()); + self::assertEquals('nl', $result->LANG->getValue()); - $this->assertEquals( + self::assertEquals( $input, $result->serialize() ); @@ -31,15 +31,15 @@ public function testChangeAndSerialize(): void $result = $mimeDir->parse($input); - $this->assertInstanceOf(LanguageTag::class, $result->LANG); + self::assertInstanceOf(LanguageTag::class, $result->LANG); // This replicates what the vcard converter does and triggered a bug in // the past. $result->LANG->setValue(['de']); - $this->assertEquals('de', $result->LANG->getValue()); + self::assertEquals('de', $result->LANG->getValue()); $expected = "BEGIN:VCARD\r\nVERSION:4.0\r\nLANG:de\r\nEND:VCARD\r\n"; - $this->assertEquals( + self::assertEquals( $expected, $result->serialize() ); diff --git a/tests/VObject/Property/VCard/PhoneNumberTest.php b/tests/VObject/Property/VCard/PhoneNumberTest.php index 939a1b58..f9882cdf 100644 --- a/tests/VObject/Property/VCard/PhoneNumberTest.php +++ b/tests/VObject/Property/VCard/PhoneNumberTest.php @@ -12,8 +12,8 @@ public function testParser(): void $input = "BEGIN:VCARD\r\nVERSION:3.0\r\nTEL;TYPE=HOME;VALUE=PHONE-NUMBER:+1234\r\nEND:VCARD\r\n"; $vCard = VObject\Reader::read($input); - $this->assertInstanceOf(PhoneNumber::class, $vCard->TEL); - $this->assertEquals('PHONE-NUMBER', $vCard->TEL->getValueType()); - $this->assertEquals($input, $vCard->serialize()); + self::assertInstanceOf(PhoneNumber::class, $vCard->TEL); + self::assertEquals('PHONE-NUMBER', $vCard->TEL->getValueType()); + self::assertEquals($input, $vCard->serialize()); } } diff --git a/tests/VObject/PropertyTest.php b/tests/VObject/PropertyTest.php index ca5033a9..b15e06b2 100644 --- a/tests/VObject/PropertyTest.php +++ b/tests/VObject/PropertyTest.php @@ -13,10 +13,10 @@ public function testToString(): void $cal = new VCalendar(); $property = $cal->createProperty('propname', 'propvalue'); - $this->assertEquals('PROPNAME', $property->name); - $this->assertEquals('propvalue', $property->__toString()); - $this->assertEquals('propvalue', (string) $property); - $this->assertEquals('propvalue', $property->getValue()); + self::assertEquals('PROPNAME', $property->name); + self::assertEquals('propvalue', $property->__toString()); + self::assertEquals('propvalue', (string) $property); + self::assertEquals('propvalue', $property->getValue()); } public function testCreate(): void @@ -30,8 +30,8 @@ public function testCreate(): void $property = $cal->createProperty('propname', 'propvalue', $params); - $this->assertEquals('value1', $property['param1']->getValue()); - $this->assertEquals('value2', $property['param2']->getValue()); + self::assertEquals('value1', $property['param1']->getValue()); + self::assertEquals('value2', $property['param2']->getValue()); } public function testSetValue(): void @@ -41,8 +41,8 @@ public function testSetValue(): void $property = $cal->createProperty('propname', 'propvalue'); $property->setValue('value2'); - $this->assertEquals('PROPNAME', $property->name); - $this->assertEquals('value2', $property->__toString()); + self::assertEquals('PROPNAME', $property->name); + self::assertEquals('value2', $property->__toString()); } public function testParameterExists(): void @@ -51,9 +51,9 @@ public function testParameterExists(): void $property = $cal->createProperty('propname', 'propvalue'); $property['paramname'] = 'paramvalue'; - $this->assertTrue(isset($property['PARAMNAME'])); - $this->assertTrue(isset($property['paramname'])); - $this->assertFalse(isset($property['foo'])); + self::assertTrue(isset($property['PARAMNAME'])); + self::assertTrue(isset($property['paramname'])); + self::assertFalse(isset($property['foo'])); } public function testParameterGet(): void @@ -62,7 +62,7 @@ public function testParameterGet(): void $property = $cal->createProperty('propname', 'propvalue'); $property['paramname'] = 'paramvalue'; - $this->assertInstanceOf(Parameter::class, $property['paramname']); + self::assertInstanceOf(Parameter::class, $property['paramname']); } public function testParameterNotExists(): void @@ -71,7 +71,7 @@ public function testParameterNotExists(): void $property = $cal->createProperty('propname', 'propvalue'); $property['paramname'] = 'paramvalue'; - $this->assertNull($property['foo']); + self::assertNull($property['foo']); } public function testParameterMultiple(): void @@ -81,8 +81,8 @@ public function testParameterMultiple(): void $property['paramname'] = 'paramvalue'; $property->add('paramname', 'paramvalue'); - $this->assertInstanceOf(Parameter::class, $property['paramname']); - $this->assertCount(2, $property['paramname']->getParts()); + self::assertInstanceOf(Parameter::class, $property['paramname']); + self::assertCount(2, $property['paramname']->getParts()); } public function testSetParameterAsString(): void @@ -91,10 +91,10 @@ public function testSetParameterAsString(): void $property = $cal->createProperty('propname', 'propvalue'); $property['paramname'] = 'paramvalue'; - $this->assertCount(1, $property->parameters()); - $this->assertInstanceOf(Parameter::class, $property->parameters['PARAMNAME']); - $this->assertEquals('PARAMNAME', $property->parameters['PARAMNAME']->name); - $this->assertEquals('paramvalue', $property->parameters['PARAMNAME']->getValue()); + self::assertCount(1, $property->parameters()); + self::assertInstanceOf(Parameter::class, $property->parameters['PARAMNAME']); + self::assertEquals('PARAMNAME', $property->parameters['PARAMNAME']->name); + self::assertEquals('paramvalue', $property->parameters['PARAMNAME']->getValue()); } public function testUnsetParameter(): void @@ -104,7 +104,7 @@ public function testUnsetParameter(): void $property['paramname'] = 'paramvalue'; unset($property['PARAMNAME']); - $this->assertCount(0, $property->parameters()); + self::assertCount(0, $property->parameters()); } public function testSerialize(): void @@ -112,7 +112,7 @@ public function testSerialize(): void $cal = new VCalendar(); $property = $cal->createProperty('propname', 'propvalue'); - $this->assertEquals("PROPNAME:propvalue\r\n", $property->serialize()); + self::assertEquals("PROPNAME:propvalue\r\n", $property->serialize()); } public function testSerializeParam(): void @@ -123,7 +123,7 @@ public function testSerializeParam(): void 'paramname2' => 'paramvalue2', ]); - $this->assertEquals("PROPNAME;PARAMNAME=paramvalue;PARAMNAME2=paramvalue2:propvalue\r\n", $property->serialize()); + self::assertEquals("PROPNAME;PARAMNAME=paramvalue;PARAMNAME2=paramvalue2:propvalue\r\n", $property->serialize()); } public function testSerializeNewLine(): void @@ -131,7 +131,7 @@ public function testSerializeNewLine(): void $cal = new VCalendar(); $property = $cal->createProperty('SUMMARY', "line1\nline2"); - $this->assertEquals("SUMMARY:line1\\nline2\r\n", $property->serialize()); + self::assertEquals("SUMMARY:line1\\nline2\r\n", $property->serialize()); } public function testSerializeLongLine(): void @@ -142,7 +142,7 @@ public function testSerializeLongLine(): void $expected = 'PROPNAME:'.str_repeat('!', 66)."\r\n ".str_repeat('!', 74)."\r\n ".str_repeat('!', 60)."\r\n"; - $this->assertEquals($expected, $property->serialize()); + self::assertEquals($expected, $property->serialize()); } public function testSerializeUTF8LineFold(): void @@ -156,7 +156,7 @@ public function testSerializeUTF8LineFold(): void // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (" " + 73x"!" = 74 bytes) // äfoo $expected = 'PROPNAME:'.str_repeat('!', 65)."\r\n \xc3\xa4bla".str_repeat('!', 69)."\r\n ".str_repeat('!', 73)."\r\n \xc3\xa4foo\r\n"; - $this->assertEquals($expected, $property->serialize()); + self::assertEquals($expected, $property->serialize()); } public function testGetIterator(): void @@ -165,7 +165,7 @@ public function testGetIterator(): void $it = new ElementList([]); $property = $cal->createProperty('propname', 'propvalue'); $property->setIterator($it); - $this->assertEquals($it, $property->getIterator()); + self::assertEquals($it, $property->getIterator()); } public function testGetIteratorDefault(): void @@ -173,8 +173,8 @@ public function testGetIteratorDefault(): void $cal = new VCalendar(); $property = $cal->createProperty('propname', 'propvalue'); $it = $property->getIterator(); - $this->assertTrue($it instanceof ElementList); - $this->assertCount(1, $it); + self::assertTrue($it instanceof ElementList); + self::assertCount(1, $it); } public function testAddScalar(): void @@ -184,11 +184,11 @@ public function testAddScalar(): void $property->add('myparam', 'value'); - $this->assertCount(1, $property->parameters()); + self::assertCount(1, $property->parameters()); - $this->assertTrue($property->parameters['MYPARAM'] instanceof Parameter); - $this->assertEquals('MYPARAM', $property->parameters['MYPARAM']->name); - $this->assertEquals('value', $property->parameters['MYPARAM']->getValue()); + self::assertTrue($property->parameters['MYPARAM'] instanceof Parameter); + self::assertEquals('MYPARAM', $property->parameters['MYPARAM']->name); + self::assertEquals('value', $property->parameters['MYPARAM']->getValue()); } public function testAddParameter(): void @@ -198,8 +198,8 @@ public function testAddParameter(): void $prop->add('MYPARAM', 'value'); - $this->assertCount(1, $prop->parameters()); - $this->assertEquals('MYPARAM', $prop['myparam']->name); + self::assertCount(1, $prop->parameters()); + self::assertEquals('MYPARAM', $prop['myparam']->name); } public function testAddParameterTwice(): void @@ -210,10 +210,10 @@ public function testAddParameterTwice(): void $prop->add('MYPARAM', 'value1'); $prop->add('MYPARAM', 'value2'); - $this->assertCount(1, $prop->parameters); - $this->assertCount(2, $prop->parameters['MYPARAM']->getParts()); + self::assertCount(1, $prop->parameters); + self::assertCount(2, $prop->parameters['MYPARAM']->getParts()); - $this->assertEquals('MYPARAM', $prop['MYPARAM']->name); + self::assertEquals('MYPARAM', $prop['MYPARAM']->name); } public function testClone(): void @@ -225,7 +225,7 @@ public function testClone(): void $property2 = clone $property; $property['FOO'] = 'BAZ'; - $this->assertEquals('BAR', (string) $property2['FOO']); + self::assertEquals('BAR', (string) $property2['FOO']); } public function testCreateParams(): void @@ -236,8 +236,8 @@ public function testCreateParams(): void 'param2' => ['value2', 'value3'], ]); - $this->assertCount(1, $property['PARAM1']->getParts()); - $this->assertCount(2, $property['PARAM2']->getParts()); + self::assertCount(1, $property['PARAM1']->getParts()); + self::assertCount(2, $property['PARAM2']->getParts()); } public function testValidateNonUTF8(): void @@ -246,8 +246,8 @@ public function testValidateNonUTF8(): void $property = $calendar->createProperty('X-PROP', "Bla\x00"); $result = $property->validate(Property::REPAIR); - $this->assertEquals('Property contained a control character (0x00)', $result[0]['message']); - $this->assertEquals('Bla', $property->getValue()); + self::assertEquals('Property contained a control character (0x00)', $result[0]['message']); + self::assertEquals('Bla', $property->getValue()); } public function testValidateControlChars(): void @@ -268,8 +268,8 @@ public function testValidateControlChars(): void $property = $calendar->createProperty('X-PROP', $s); $result = $property->validate(Property::REPAIR); - $this->assertEquals('Property contained a control character (0x7f)', $result[0]['message']); - $this->assertEquals("chars[7F()5E(^)5C(\\\\)3B(\\;)3A(:)2C(\\,)22(\")20( )1F()1E()1D()1C()1B()1A()19()18()17()16()15()14()13()12()11()10()0F()0E()0D()0C()0B()0A(\\n)09(\t)08()07()06()05()04()03()02()01()00()]end", $property->getRawMimeDirValue()); + self::assertEquals('Property contained a control character (0x7f)', $result[0]['message']); + self::assertEquals("chars[7F()5E(^)5C(\\\\)3B(\\;)3A(:)2C(\\,)22(\")20( )1F()1E()1D()1C()1B()1A()19()18()17()16()15()14()13()12()11()10()0F()0E()0D()0C()0B()0A(\\n)09(\t)08()07()06()05()04()03()02()01()00()]end", $property->getRawMimeDirValue()); } /** @@ -281,8 +281,8 @@ public function testValidateBadPropertyName(): void $property = $calendar->createProperty('X_*&PROP*', 'Bla'); $result = $property->validate(Node::REPAIR); - $this->assertEquals('The property name: X_*&PROP* contains invalid characters. Only A-Z, 0-9 and - are allowed', $result[0]['message']); - $this->assertEquals('X-PROP', $property->name); + self::assertEquals('The property name: X_*&PROP* contains invalid characters. Only A-Z, 0-9 and - are allowed', $result[0]['message']); + self::assertEquals('X-PROP', $property->name); } /** @@ -292,24 +292,24 @@ public function testGetValue(): void { $calendar = new VCalendar(); $property = $calendar->createProperty('SUMMARY', null); - $this->assertEquals([], $property->getParts()); - $this->assertNull($property->getValue()); + self::assertEquals([], $property->getParts()); + self::assertNull($property->getValue()); $property->setValue([]); - $this->assertEquals([], $property->getParts()); - $this->assertNull($property->getValue()); + self::assertEquals([], $property->getParts()); + self::assertNull($property->getValue()); $property->setValue([1]); - $this->assertEquals([1], $property->getParts()); - $this->assertEquals(1, $property->getValue()); + self::assertEquals([1], $property->getParts()); + self::assertEquals(1, $property->getValue()); $property->setValue([1, 2]); - $this->assertEquals([1, 2], $property->getParts()); - $this->assertEquals('1,2', $property->getValue()); + self::assertEquals([1, 2], $property->getParts()); + self::assertEquals('1,2', $property->getValue()); $property->setValue('str'); - $this->assertEquals(['str'], $property->getParts()); - $this->assertEquals('str', $property->getValue()); + self::assertEquals(['str'], $property->getParts()); + self::assertEquals('str', $property->getValue()); } /** @@ -346,8 +346,8 @@ public function testValidateBadEncoding(): void $result = $property->validate(); - $this->assertEquals('ENCODING=INVALID is not valid for this document type.', $result[0]['message']); - $this->assertEquals(3, $result[0]['level']); + self::assertEquals('ENCODING=INVALID is not valid for this document type.', $result[0]['message']); + self::assertEquals(3, $result[0]['level']); } public function testValidateBadEncodingVCard4(): void @@ -358,8 +358,8 @@ public function testValidateBadEncodingVCard4(): void $result = $property->validate(); - $this->assertEquals('ENCODING parameter is not valid in vCard 4.', $result[0]['message']); - $this->assertEquals(3, $result[0]['level']); + self::assertEquals('ENCODING parameter is not valid in vCard 4.', $result[0]['message']); + self::assertEquals(3, $result[0]['level']); } public function testValidateBadEncodingVCard3(): void @@ -370,14 +370,14 @@ public function testValidateBadEncodingVCard3(): void $result = $property->validate(); - $this->assertEquals('ENCODING=BASE64 is not valid for this document type.', $result[0]['message']); - $this->assertEquals(3, $result[0]['level']); + self::assertEquals('ENCODING=BASE64 is not valid for this document type.', $result[0]['message']); + self::assertEquals(3, $result[0]['level']); // Validate the reparation of BASE64 formatted vCard v3 $result = $property->validate(Property::REPAIR); - $this->assertEquals('ENCODING=BASE64 has been transformed to ENCODING=B.', $result[0]['message']); - $this->assertEquals(1, $result[0]['level']); + self::assertEquals('ENCODING=BASE64 has been transformed to ENCODING=B.', $result[0]['message']); + self::assertEquals(1, $result[0]['level']); } public function testValidateBadEncodingVCard21(): void @@ -388,7 +388,7 @@ public function testValidateBadEncodingVCard21(): void $result = $property->validate(); - $this->assertEquals('ENCODING=B is not valid for this document type.', $result[0]['message']); - $this->assertEquals(3, $result[0]['level']); + self::assertEquals('ENCODING=B is not valid for this document type.', $result[0]['message']); + self::assertEquals(3, $result[0]['level']); } } diff --git a/tests/VObject/ReaderTest.php b/tests/VObject/ReaderTest.php index dcdd6b0d..645ed181 100644 --- a/tests/VObject/ReaderTest.php +++ b/tests/VObject/ReaderTest.php @@ -12,9 +12,9 @@ public function testReadComponent(): void $result = Reader::read($data); - $this->assertInstanceOf(Component::class, $result); - $this->assertEquals('VCALENDAR', $result->name); - $this->assertCount(0, $result->children()); + self::assertInstanceOf(Component::class, $result); + self::assertEquals('VCALENDAR', $result->name); + self::assertCount(0, $result->children()); } public function testReadStream(): void @@ -27,9 +27,9 @@ public function testReadStream(): void $result = Reader::read($stream); - $this->assertInstanceOf(Component::class, $result); - $this->assertEquals('VCALENDAR', $result->name); - $this->assertCount(0, $result->children()); + self::assertInstanceOf(Component::class, $result); + self::assertEquals('VCALENDAR', $result->name); + self::assertCount(0, $result->children()); } public function testReadComponentUnixNewLine(): void @@ -38,9 +38,9 @@ public function testReadComponentUnixNewLine(): void $result = Reader::read($data); - $this->assertInstanceOf(Component::class, $result); - $this->assertEquals('VCALENDAR', $result->name); - $this->assertCount(0, $result->children()); + self::assertInstanceOf(Component::class, $result); + self::assertEquals('VCALENDAR', $result->name); + self::assertCount(0, $result->children()); } public function testReadComponentLineFold(): void @@ -49,9 +49,9 @@ public function testReadComponentLineFold(): void $result = Reader::read($data); - $this->assertInstanceOf(Component::class, $result); - $this->assertEquals('VCALENDAR', $result->name); - $this->assertCount(0, $result->children()); + self::assertInstanceOf(Component::class, $result); + self::assertEquals('VCALENDAR', $result->name); + self::assertCount(0, $result->children()); } public function testReadCorruptComponent(): void @@ -76,9 +76,9 @@ public function testReadProperty(): void $result = Reader::read($data); $result = $result->SUMMARY; - $this->assertInstanceOf(Property::class, $result); - $this->assertEquals('SUMMARY', $result->name); - $this->assertEquals('propValue', $result->getValue()); + self::assertInstanceOf(Property::class, $result); + self::assertEquals('SUMMARY', $result->name); + self::assertEquals('propValue', $result->getValue()); } public function testReadPropertyWithNewLine(): void @@ -87,9 +87,9 @@ public function testReadPropertyWithNewLine(): void $result = Reader::read($data); $result = $result->SUMMARY; - $this->assertInstanceOf(Property::class, $result); - $this->assertEquals('SUMMARY', $result->name); - $this->assertEquals("Line1\nLine2\nLine3\\Not the 4th line!", $result->getValue()); + self::assertInstanceOf(Property::class, $result); + self::assertEquals('SUMMARY', $result->name); + self::assertEquals("Line1\nLine2\nLine3\\Not the 4th line!", $result->getValue()); } public function testReadMappedProperty(): void @@ -98,9 +98,9 @@ public function testReadMappedProperty(): void $result = Reader::read($data); $result = $result->DTSTART; - $this->assertInstanceOf(Property\ICalendar\DateTime::class, $result); - $this->assertEquals('DTSTART', $result->name); - $this->assertEquals('20110529', $result->getValue()); + self::assertInstanceOf(Property\ICalendar\DateTime::class, $result); + self::assertEquals('DTSTART', $result->name); + self::assertEquals('20110529', $result->getValue()); } public function testReadMappedPropertyGrouped(): void @@ -109,21 +109,21 @@ public function testReadMappedPropertyGrouped(): void $result = Reader::read($data); $result = $result->DTSTART; - $this->assertInstanceOf(Property\ICalendar\DateTime::class, $result); - $this->assertEquals('DTSTART', $result->name); - $this->assertEquals('20110529', $result->getValue()); + self::assertInstanceOf(Property\ICalendar\DateTime::class, $result); + self::assertEquals('DTSTART', $result->name); + self::assertEquals('20110529', $result->getValue()); } public function testReadMissingEnd(): void { $data = "BEGIN:VCALENDAR\r\nPROPNAME:propValue"; $result = Reader::read($data); - $this->assertInstanceOf(Component::class, $result); - $this->assertEquals('VCALENDAR', $result->name); - $this->assertCount(1, $result->children()); - $this->assertInstanceOf(Property::class, $result->children()[0]); - $this->assertEquals('PROPNAME', $result->children()[0]->name); - $this->assertEquals('propValue', $result->children()[0]->getValue()); + self::assertInstanceOf(Component::class, $result); + self::assertEquals('VCALENDAR', $result->name); + self::assertCount(1, $result->children()); + self::assertInstanceOf(Property::class, $result->children()[0]); + self::assertEquals('PROPNAME', $result->children()[0]->name); + self::assertEquals('propValue', $result->children()[0]->getValue()); } public function testReadPropertyInComponent(): void @@ -136,12 +136,12 @@ public function testReadPropertyInComponent(): void $result = Reader::read(implode("\r\n", $data)); - $this->assertInstanceOf(Component::class, $result); - $this->assertEquals('VCALENDAR', $result->name); - $this->assertCount(1, $result->children()); - $this->assertInstanceOf(Property::class, $result->children()[0]); - $this->assertEquals('PROPNAME', $result->children()[0]->name); - $this->assertEquals('propValue', $result->children()[0]->getValue()); + self::assertInstanceOf(Component::class, $result); + self::assertEquals('VCALENDAR', $result->name); + self::assertCount(1, $result->children()); + self::assertInstanceOf(Property::class, $result->children()[0]); + self::assertEquals('PROPNAME', $result->children()[0]->name); + self::assertEquals('propValue', $result->children()[0]->getValue()); } public function testReadNestedComponent(): void @@ -157,14 +157,14 @@ public function testReadNestedComponent(): void $result = Reader::read(implode("\r\n", $data)); - $this->assertInstanceOf(Component::class, $result); - $this->assertEquals('VCALENDAR', $result->name); - $this->assertCount(1, $result->children()); - $this->assertInstanceOf(Component::class, $result->children()[0]); - $this->assertEquals('VTIMEZONE', $result->children()[0]->name); - $this->assertCount(1, $result->children()[0]->children()); - $this->assertInstanceOf(Component::class, $result->children()[0]->children()[0]); - $this->assertEquals('DAYLIGHT', $result->children()[0]->children()[0]->name); + self::assertInstanceOf(Component::class, $result); + self::assertEquals('VCALENDAR', $result->name); + self::assertCount(1, $result->children()); + self::assertInstanceOf(Component::class, $result->children()[0]); + self::assertEquals('VTIMEZONE', $result->children()[0]->name); + self::assertCount(1, $result->children()[0]->children()); + self::assertInstanceOf(Component::class, $result->children()[0]->children()[0]); + self::assertEquals('DAYLIGHT', $result->children()[0]->children()[0]->name); } public function testReadPropertyParameter(): void @@ -174,12 +174,12 @@ public function testReadPropertyParameter(): void $result = $result->PROPNAME; - $this->assertInstanceOf(Property::class, $result); - $this->assertEquals('PROPNAME', $result->name); - $this->assertEquals('propValue', $result->getValue()); - $this->assertCount(1, $result->parameters()); - $this->assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name); - $this->assertEquals('paramvalue', $result->parameters['PARAMNAME']->getValue()); + self::assertInstanceOf(Property::class, $result); + self::assertEquals('PROPNAME', $result->name); + self::assertEquals('propValue', $result->getValue()); + self::assertCount(1, $result->parameters()); + self::assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name); + self::assertEquals('paramvalue', $result->parameters['PARAMNAME']->getValue()); } public function testReadPropertyRepeatingParameter(): void @@ -189,13 +189,13 @@ public function testReadPropertyRepeatingParameter(): void $result = $result->PROPNAME; - $this->assertInstanceOf(Property::class, $result); - $this->assertEquals('PROPNAME', $result->name); - $this->assertEquals('propValue', $result->getValue()); - $this->assertCount(1, $result->parameters()); - $this->assertEquals('N', $result->parameters['N']->name); - $this->assertEquals('1,2,3,4,5,6,7,8,9,10,"11"', $result->parameters['N']->getValue()); - $this->assertEquals([1, 2, 3, 4, 5, 6, '7,8', 9, 10, '"11"'], $result->parameters['N']->getParts()); + self::assertInstanceOf(Property::class, $result); + self::assertEquals('PROPNAME', $result->name); + self::assertEquals('propValue', $result->getValue()); + self::assertCount(1, $result->parameters()); + self::assertEquals('N', $result->parameters['N']->name); + self::assertEquals('1,2,3,4,5,6,7,8,9,10,"11"', $result->parameters['N']->getValue()); + self::assertEquals([1, 2, 3, 4, 5, 6, '7,8', 9, 10, '"11"'], $result->parameters['N']->getParts()); } public function testReadPropertyRepeatingNamelessGuessedParameter(): void @@ -205,13 +205,13 @@ public function testReadPropertyRepeatingNamelessGuessedParameter(): void $result = $result->PROPNAME; - $this->assertInstanceOf(Property::class, $result); - $this->assertEquals('PROPNAME', $result->name); - $this->assertEquals('propValue', $result->getValue()); - $this->assertCount(1, $result->parameters()); - $this->assertEquals('TYPE', $result->parameters['TYPE']->name); - $this->assertEquals('WORK,VOICE,PREF', $result->parameters['TYPE']->getValue()); - $this->assertEquals(['WORK', 'VOICE', 'PREF'], $result->parameters['TYPE']->getParts()); + self::assertInstanceOf(Property::class, $result); + self::assertEquals('PROPNAME', $result->name); + self::assertEquals('propValue', $result->getValue()); + self::assertCount(1, $result->parameters()); + self::assertEquals('TYPE', $result->parameters['TYPE']->name); + self::assertEquals('WORK,VOICE,PREF', $result->parameters['TYPE']->getValue()); + self::assertEquals(['WORK', 'VOICE', 'PREF'], $result->parameters['TYPE']->getParts()); } public function testReadPropertyNoName(): void @@ -221,13 +221,13 @@ public function testReadPropertyNoName(): void $result = $result->PROPNAME; - $this->assertInstanceOf(Property::class, $result); - $this->assertEquals('PROPNAME', $result->name); - $this->assertEquals('propValue', $result->getValue()); - $this->assertCount(1, $result->parameters()); - $this->assertEquals('TYPE', $result->parameters['TYPE']->name); - $this->assertTrue($result->parameters['TYPE']->noName); - $this->assertEquals('PRODIGY', $result->parameters['TYPE']); + self::assertInstanceOf(Property::class, $result); + self::assertEquals('PROPNAME', $result->name); + self::assertEquals('propValue', $result->getValue()); + self::assertCount(1, $result->parameters()); + self::assertEquals('TYPE', $result->parameters['TYPE']->name); + self::assertTrue($result->parameters['TYPE']->noName); + self::assertEquals('PRODIGY', $result->parameters['TYPE']); } public function testReadPropertyParameterExtraColon(): void @@ -237,12 +237,12 @@ public function testReadPropertyParameterExtraColon(): void $result = $result->PROPNAME; - $this->assertInstanceOf(Property::class, $result); - $this->assertEquals('PROPNAME', $result->name); - $this->assertEquals('propValue:anotherrandomstring', $result->getValue()); - $this->assertCount(1, $result->parameters()); - $this->assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name); - $this->assertEquals('paramvalue', $result->parameters['PARAMNAME']->getValue()); + self::assertInstanceOf(Property::class, $result); + self::assertEquals('PROPNAME', $result->name); + self::assertEquals('propValue:anotherrandomstring', $result->getValue()); + self::assertCount(1, $result->parameters()); + self::assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name); + self::assertEquals('paramvalue', $result->parameters['PARAMNAME']->getValue()); } public function testReadProperty2Parameters(): void @@ -252,14 +252,14 @@ public function testReadProperty2Parameters(): void $result = $result->PROPNAME; - $this->assertInstanceOf(Property::class, $result); - $this->assertEquals('PROPNAME', $result->name); - $this->assertEquals('propValue', $result->getValue()); - $this->assertCount(2, $result->parameters()); - $this->assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name); - $this->assertEquals('paramvalue', $result->parameters['PARAMNAME']->getValue()); - $this->assertEquals('PARAMNAME2', $result->parameters['PARAMNAME2']->name); - $this->assertEquals('paramvalue2', $result->parameters['PARAMNAME2']->getValue()); + self::assertInstanceOf(Property::class, $result); + self::assertEquals('PROPNAME', $result->name); + self::assertEquals('propValue', $result->getValue()); + self::assertCount(2, $result->parameters()); + self::assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name); + self::assertEquals('paramvalue', $result->parameters['PARAMNAME']->getValue()); + self::assertEquals('PARAMNAME2', $result->parameters['PARAMNAME2']->name); + self::assertEquals('paramvalue2', $result->parameters['PARAMNAME2']->getValue()); } public function testReadPropertyParameterQuoted(): void @@ -269,12 +269,12 @@ public function testReadPropertyParameterQuoted(): void $result = $result->PROPNAME; - $this->assertInstanceOf(Property::class, $result); - $this->assertEquals('PROPNAME', $result->name); - $this->assertEquals('propValue', $result->getValue()); - $this->assertCount(1, $result->parameters()); - $this->assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name); - $this->assertEquals('paramvalue', $result->parameters['PARAMNAME']->getValue()); + self::assertInstanceOf(Property::class, $result); + self::assertEquals('PROPNAME', $result->name); + self::assertEquals('propValue', $result->getValue()); + self::assertCount(1, $result->parameters()); + self::assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name); + self::assertEquals('paramvalue', $result->parameters['PARAMNAME']->getValue()); } public function testReadPropertyParameterNewLines(): void @@ -284,13 +284,13 @@ public function testReadPropertyParameterNewLines(): void $result = $result->PROPNAME; - $this->assertInstanceOf(Property::class, $result); - $this->assertEquals('PROPNAME', $result->name); - $this->assertEquals('propValue', $result->getValue()); + self::assertInstanceOf(Property::class, $result); + self::assertEquals('PROPNAME', $result->name); + self::assertEquals('propValue', $result->getValue()); - $this->assertCount(1, $result->parameters()); - $this->assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name); - $this->assertEquals("paramvalue1\nvalue2^nvalue3", $result->parameters['PARAMNAME']->getValue()); + self::assertCount(1, $result->parameters()); + self::assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name); + self::assertEquals("paramvalue1\nvalue2^nvalue3", $result->parameters['PARAMNAME']->getValue()); } public function testReadPropertyParameterQuotedColon(): void @@ -299,12 +299,12 @@ public function testReadPropertyParameterQuotedColon(): void $result = Reader::read($data); $result = $result->PROPNAME; - $this->assertInstanceOf(Property::class, $result); - $this->assertEquals('PROPNAME', $result->name); - $this->assertEquals('propValue', $result->getValue()); - $this->assertCount(1, $result->parameters()); - $this->assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name); - $this->assertEquals('param:value', $result->parameters['PARAMNAME']->getValue()); + self::assertInstanceOf(Property::class, $result); + self::assertEquals('PROPNAME', $result->name); + self::assertEquals('propValue', $result->getValue()); + self::assertCount(1, $result->parameters()); + self::assertEquals('PARAMNAME', $result->parameters['PARAMNAME']->name); + self::assertEquals('param:value', $result->parameters['PARAMNAME']->getValue()); } public function testReadForgiving(): void @@ -322,7 +322,7 @@ public function testReadForgiving(): void $caught = true; } - $this->assertEquals(true, $caught); + self::assertEquals(true, $caught); $result = Reader::read(implode("\r\n", $data), Reader::OPTION_FORGIVING); @@ -333,7 +333,7 @@ public function testReadForgiving(): void '', ]); - $this->assertEquals($expected, $result->serialize()); + self::assertEquals($expected, $result->serialize()); } public function testReadWithInvalidLine(): void @@ -352,7 +352,7 @@ public function testReadWithInvalidLine(): void $caught = true; } - $this->assertEquals(true, $caught); + self::assertEquals(true, $caught); $result = Reader::read(implode("\r\n", $data), Reader::OPTION_IGNORE_INVALID_LINES); @@ -363,7 +363,7 @@ public function testReadWithInvalidLine(): void '', ]); - $this->assertEquals($expected, $result->serialize()); + self::assertEquals($expected, $result->serialize()); } /** @@ -413,9 +413,9 @@ public function testReadBOM(): void $data = chr(0xEF).chr(0xBB).chr(0xBF)."BEGIN:VCALENDAR\r\nEND:VCALENDAR"; $result = Reader::read($data); - $this->assertInstanceOf(Component::class, $result); - $this->assertEquals('VCALENDAR', $result->name); - $this->assertCount(0, $result->children()); + self::assertInstanceOf(Component::class, $result); + self::assertEquals('VCALENDAR', $result->name); + self::assertCount(0, $result->children()); } public function testReadXMLComponent(): void @@ -430,9 +430,9 @@ public function testReadXMLComponent(): void $result = Reader::readXML($data); - $this->assertInstanceOf(Component::class, $result); - $this->assertEquals('VCALENDAR', $result->name); - $this->assertCount(0, $result->children()); + self::assertInstanceOf(Component::class, $result); + self::assertEquals('VCALENDAR', $result->name); + self::assertCount(0, $result->children()); } public function testReadXMLStream(): void @@ -451,8 +451,8 @@ public function testReadXMLStream(): void $result = Reader::readXML($stream); - $this->assertInstanceOf(Component::class, $result); - $this->assertEquals('VCALENDAR', $result->name); - $this->assertCount(0, $result->children()); + self::assertInstanceOf(Component::class, $result); + self::assertEquals('VCALENDAR', $result->name); + self::assertCount(0, $result->children()); } } diff --git a/tests/VObject/Recur/EventIterator/ByMonthInDailyTest.php b/tests/VObject/Recur/EventIterator/ByMonthInDailyTest.php index 3e1fb199..9b6b20df 100644 --- a/tests/VObject/Recur/EventIterator/ByMonthInDailyTest.php +++ b/tests/VObject/Recur/EventIterator/ByMonthInDailyTest.php @@ -36,7 +36,7 @@ public function testExpand(): void ICS; $vcal = Reader::read($ics); - $this->assertInstanceOf(VCalendar::class, $vcal); + self::assertInstanceOf(VCalendar::class, $vcal); $vcal = $vcal->expand(new \DateTime('2013-09-28'), new \DateTime('2014-09-11')); @@ -54,6 +54,6 @@ public function testExpand(): void '20140907T160000Z', ]; - $this->assertEquals($expectedDates, $dates, 'Recursed dates are restricted by month'); + self::assertEquals($expectedDates, $dates, 'Recursed dates are restricted by month'); } } diff --git a/tests/VObject/Recur/EventIterator/BySetPosHangTest.php b/tests/VObject/Recur/EventIterator/BySetPosHangTest.php index 04055c72..f5132e1d 100644 --- a/tests/VObject/Recur/EventIterator/BySetPosHangTest.php +++ b/tests/VObject/Recur/EventIterator/BySetPosHangTest.php @@ -31,7 +31,7 @@ public function testExpand(): void ICS; $vcal = Reader::read($ics); - $this->assertInstanceOf(VCalendar::class, $vcal); + self::assertInstanceOf(VCalendar::class, $vcal); $vcal = $vcal->expand(new \DateTime('2015-01-01'), new \DateTime('2016-01-01')); @@ -56,6 +56,6 @@ public function testExpand(): void '20151224T160000Z', ]; - $this->assertEquals($expectedDates, $dates); + self::assertEquals($expectedDates, $dates); } } diff --git a/tests/VObject/Recur/EventIterator/ExpandFloatingTimesTest.php b/tests/VObject/Recur/EventIterator/ExpandFloatingTimesTest.php index e764a76c..a7a39d1d 100644 --- a/tests/VObject/Recur/EventIterator/ExpandFloatingTimesTest.php +++ b/tests/VObject/Recur/EventIterator/ExpandFloatingTimesTest.php @@ -25,7 +25,7 @@ public function testExpand(): void ICS; $vcal = Reader::read($input); - $this->assertInstanceOf(VCalendar::class, $vcal); + self::assertInstanceOf(VCalendar::class, $vcal); $vcal = $vcal->expand(new \DateTime('2015-01-01'), new \DateTime('2015-01-31')); $output = <<assertVObjectEqualsVObject($output, $vcal); + self::assertVObjectEqualsVObject($output, $vcal); } public function testExpandWithReferenceTimezone(): void @@ -76,7 +76,7 @@ public function testExpandWithReferenceTimezone(): void ICS; $vcal = Reader::read($input); - $this->assertInstanceOf(VCalendar::class, $vcal); + self::assertInstanceOf(VCalendar::class, $vcal); $vcal = $vcal->expand( new \DateTime('2015-01-01'), @@ -114,6 +114,6 @@ public function testExpandWithReferenceTimezone(): void END:VCALENDAR ICS; - $this->assertVObjectEqualsVObject($output, $vcal); + self::assertVObjectEqualsVObject($output, $vcal); } } diff --git a/tests/VObject/Recur/EventIterator/FifthTuesdayProblemTest.php b/tests/VObject/Recur/EventIterator/FifthTuesdayProblemTest.php index 018af065..8391a232 100644 --- a/tests/VObject/Recur/EventIterator/FifthTuesdayProblemTest.php +++ b/tests/VObject/Recur/EventIterator/FifthTuesdayProblemTest.php @@ -48,6 +48,6 @@ public function testGetDTEnd(): void // If we got here, it means we were successful. The bug that was in the // system before would fail on the 5th tuesday of the month, if the 5th // tuesday did not exist. - $this->assertTrue(true); + self::assertTrue(true); } } diff --git a/tests/VObject/Recur/EventIterator/HandleRDateExpandTest.php b/tests/VObject/Recur/EventIterator/HandleRDateExpandTest.php index e3ec52e2..4f434dd2 100644 --- a/tests/VObject/Recur/EventIterator/HandleRDateExpandTest.php +++ b/tests/VObject/Recur/EventIterator/HandleRDateExpandTest.php @@ -34,13 +34,13 @@ public function testExpand(): void ICS; $vcal = Reader::read($input); - $this->assertInstanceOf(VCalendar::class, $vcal); + self::assertInstanceOf(VCalendar::class, $vcal); $vcal = $vcal->expand(new \DateTime('2015-01-01'), new \DateTime('2015-12-01')); $result = iterator_to_array($vcal->VEVENT); - $this->assertCount(5, $result); + self::assertCount(5, $result); $utc = new \DateTimeZone('UTC'); $expected = [ @@ -52,6 +52,6 @@ public function testExpand(): void ]; $result = array_map(function ($ev) {return $ev->DTSTART->getDateTime(); }, $result); - $this->assertEquals($expected, $result); + self::assertEquals($expected, $result); } } diff --git a/tests/VObject/Recur/EventIterator/IncorrectExpandTest.php b/tests/VObject/Recur/EventIterator/IncorrectExpandTest.php index 3e5dad08..b0ecbbdb 100644 --- a/tests/VObject/Recur/EventIterator/IncorrectExpandTest.php +++ b/tests/VObject/Recur/EventIterator/IncorrectExpandTest.php @@ -34,7 +34,7 @@ public function testExpand(): void ICS; $vcal = Reader::read($input); - $this->assertInstanceOf(VCalendar::class, $vcal); + self::assertInstanceOf(VCalendar::class, $vcal); $vcal = $vcal->expand(new \DateTime('2011-01-01'), new \DateTime('2014-01-01')); @@ -56,6 +56,6 @@ public function testExpand(): void END:VCALENDAR ICS; - $this->assertVObjectEqualsVObject($output, $vcal); + self::assertVObjectEqualsVObject($output, $vcal); } } diff --git a/tests/VObject/Recur/EventIterator/InfiniteLoopProblemTest.php b/tests/VObject/Recur/EventIterator/InfiniteLoopProblemTest.php index dafbf70f..591140e6 100644 --- a/tests/VObject/Recur/EventIterator/InfiniteLoopProblemTest.php +++ b/tests/VObject/Recur/EventIterator/InfiniteLoopProblemTest.php @@ -27,7 +27,7 @@ public function testFastForwardTooFar(): void $ev->DTSTART = '20090420T180000Z'; $ev->RRULE = 'FREQ=WEEKLY;BYDAY=MO;UNTIL=20090704T205959Z;INTERVAL=1'; - $this->assertFalse($ev->isInTimeRange(new \DateTimeImmutable('2012-01-01 12:00:00'), new \DateTimeImmutable('3000-01-01 00:00:00'))); + self::assertFalse($ev->isInTimeRange(new \DateTimeImmutable('2012-01-01 12:00:00'), new \DateTimeImmutable('3000-01-01 00:00:00'))); } /** @@ -64,7 +64,7 @@ public function testYearlyByMonthLoop(): void $it->next(); } - $this->assertEquals( + self::assertEquals( [new \DateTimeImmutable('2012-02-01 15:45:00', new \DateTimeZone('Europe/Berlin'))], $collect ); diff --git a/tests/VObject/Recur/EventIterator/Issue26Test.php b/tests/VObject/Recur/EventIterator/Issue26Test.php index 3be5edf0..06cd6388 100644 --- a/tests/VObject/Recur/EventIterator/Issue26Test.php +++ b/tests/VObject/Recur/EventIterator/Issue26Test.php @@ -26,7 +26,7 @@ public function testExpand(): void ICS; $vcal = Reader::read($input); - $this->assertInstanceOf(VCalendar::class, $vcal); + self::assertInstanceOf(VCalendar::class, $vcal); new EventIterator($vcal, 'bae5d57a98'); } diff --git a/tests/VObject/Recur/EventIterator/Issue48Test.php b/tests/VObject/Recur/EventIterator/Issue48Test.php index 84a8e901..d2b80936 100644 --- a/tests/VObject/Recur/EventIterator/Issue48Test.php +++ b/tests/VObject/Recur/EventIterator/Issue48Test.php @@ -29,7 +29,7 @@ public function testExpand(): void ICS; $vcal = Reader::read($input); - $this->assertInstanceOf(VCalendar::class, $vcal); + self::assertInstanceOf(VCalendar::class, $vcal); $it = new EventIterator($vcal, 'foo'); @@ -43,6 +43,6 @@ public function testExpand(): void new \DateTimeImmutable('2013-07-13 11:00:00', $tz), ]; - $this->assertEquals($expected, $result); + self::assertEquals($expected, $result); } } diff --git a/tests/VObject/Recur/EventIterator/Issue50Test.php b/tests/VObject/Recur/EventIterator/Issue50Test.php index 4e1fd33f..ec05de1b 100644 --- a/tests/VObject/Recur/EventIterator/Issue50Test.php +++ b/tests/VObject/Recur/EventIterator/Issue50Test.php @@ -103,7 +103,7 @@ public function testExpand(): void ICS; $vcal = Reader::read($input); - $this->assertInstanceOf(VCalendar::class, $vcal); + self::assertInstanceOf(VCalendar::class, $vcal); $it = new EventIterator($vcal, '1aef0b27-3d92-4581-829a-11999dd36724'); @@ -114,7 +114,7 @@ public function testExpand(): void $tz = new \DateTimeZone('Europe/Brussels'); - $this->assertEquals([ + self::assertEquals([ new \DateTimeImmutable('2013-07-15 09:00:00', $tz), new \DateTimeImmutable('2013-07-16 07:00:00', $tz), new \DateTimeImmutable('2013-07-17 07:00:00', $tz), diff --git a/tests/VObject/Recur/EventIterator/MainTest.php b/tests/VObject/Recur/EventIterator/MainTest.php index af4a8be7..bce4bcd9 100644 --- a/tests/VObject/Recur/EventIterator/MainTest.php +++ b/tests/VObject/Recur/EventIterator/MainTest.php @@ -35,7 +35,7 @@ public function testValues(): void $it = new EventIterator($vcal, (string) $ev->UID); - $this->assertTrue($it->isInfinite()); + self::assertTrue($it->isInfinite()); } /** @@ -122,7 +122,7 @@ public function testHourly(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-10-07 12:00:00', $tz), new \DateTimeImmutable('2011-10-07 15:00:00', $tz), @@ -181,7 +181,7 @@ public function testDaily(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-10-07', $tz), new \DateTimeImmutable('2011-10-10', $tz), @@ -227,7 +227,7 @@ public function testNoRRULE(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-10-07', $tz), ], @@ -268,7 +268,7 @@ public function testDailyByDayByHour(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-10-08 06:00:00', $tz), new \DateTimeImmutable('2011-10-08 07:00:00', $tz), @@ -320,7 +320,7 @@ public function testDailyByHour(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2012-10-11 12:00:00', $tz), new \DateTimeImmutable('2012-10-11 13:00:00', $tz), @@ -372,7 +372,7 @@ public function testDailyByDay(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-10-07', $tz), new \DateTimeImmutable('2011-10-11', $tz), @@ -424,7 +424,7 @@ public function testWeekly(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-10-07', $tz), new \DateTimeImmutable('2011-10-21', $tz), @@ -474,7 +474,7 @@ public function testWeeklyByDayByHour(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-10-07 08:00:00', $tz), new \DateTimeImmutable('2011-10-07 09:00:00', $tz), @@ -529,7 +529,7 @@ public function testWeeklyByDaySpecificHour(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-10-07 18:00:00', $tz), new \DateTimeImmutable('2011-10-18 18:00:00', $tz), @@ -581,7 +581,7 @@ public function testWeeklyByDay(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-10-07', $tz), new \DateTimeImmutable('2011-10-18', $tz), @@ -632,7 +632,7 @@ public function testMonthly(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-12-05', $tz), new \DateTimeImmutable('2012-03-05', $tz), @@ -676,7 +676,7 @@ public function testMonthlyEndOfMonth(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-12-31', $tz), new \DateTimeImmutable('2012-08-31', $tz), @@ -734,7 +734,7 @@ public function testMonthlyByMonthDay(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-01-01', $tz), new \DateTimeImmutable('2011-01-25', $tz), @@ -787,7 +787,7 @@ public function testMonthlyByDay(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-01-03', $tz), new \DateTimeImmutable('2011-01-05', $tz), @@ -842,7 +842,7 @@ public function testMonthlyByDayByMonthDay(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-08-01', $tz), new \DateTimeImmutable('2012-10-01', $tz), @@ -891,7 +891,7 @@ public function testMonthlyByDayBySetPos(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-01-03', $tz), new \DateTimeImmutable('2011-01-31', $tz), @@ -945,7 +945,7 @@ public function testYearly(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-01-01', $tz), new \DateTimeImmutable('2014-01-01', $tz), @@ -994,7 +994,7 @@ public function testYearlyLeapYear(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2012-02-29', $tz), new \DateTimeImmutable('2016-02-29', $tz), @@ -1036,7 +1036,7 @@ public function testYearlyByMonth(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-04-07', $tz), new \DateTimeImmutable('2011-10-07', $tz), @@ -1083,7 +1083,7 @@ public function testYearlyByMonthByDay(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-04-04', $tz), new \DateTimeImmutable('2011-04-24', $tz), @@ -1133,7 +1133,7 @@ public function testFastForward(): void $it->next(); } - $this->assertEquals([], $result); + self::assertEquals([], $result); } /** @@ -1161,7 +1161,7 @@ public function testFastForwardAllDayEventThatStopAtTheStartTime(): void $it->fastForward(new \DateTimeImmutable('2011-04-05T000000', new \DateTimeZone('UTC'))); - $this->assertEquals(new \DateTimeImmutable('2011-04-06'), $it->getDTStart()); + self::assertEquals(new \DateTimeImmutable('2011-04-06'), $it->getDTStart()); } /** @@ -1212,7 +1212,7 @@ public function testComplexExclusions(): void } } - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-01-01 13:50:20', $tz), new \DateTimeImmutable('2013-01-01 13:50:20', $tz), @@ -1270,7 +1270,7 @@ public function testOverriddenEvent(): void } $tz = new \DateTimeZone('UTC'); - $this->assertEquals([ + self::assertEquals([ new \DateTimeImmutable('2012-01-07 12:00:00', $tz), new \DateTimeImmutable('2012-01-08 12:00:00', $tz), new \DateTimeImmutable('2012-01-09 12:00:00', $tz), @@ -1283,7 +1283,7 @@ public function testOverriddenEvent(): void new \DateTimeImmutable('2012-01-16 12:00:00', $tz), ], $dates); - $this->assertEquals([ + self::assertEquals([ 'baseEvent', 'baseEvent', 'baseEvent', @@ -1332,13 +1332,13 @@ public function testOverriddenEvent2(): void } $tz = new \DateTimeZone('UTC'); - $this->assertEquals([ + self::assertEquals([ new \DateTimeImmutable('2012-01-12 12:00:00', $tz), new \DateTimeImmutable('2012-01-13 12:00:00', $tz), new \DateTimeImmutable('2012-01-26 12:00:00', $tz), ], $dates); - $this->assertEquals([ + self::assertEquals([ 'baseEvent', 'Override!', 'baseEvent', @@ -1388,8 +1388,8 @@ public function testOverriddenEventNoValuesExpected(): void $it->next(); } - $this->assertEquals([], $dates); - $this->assertEquals([], $summaries); + self::assertEquals([], $dates); + self::assertEquals([], $summaries); } /** @@ -1428,7 +1428,7 @@ public function testRDATE(): void $tz = new \DateTimeZone('UTC'); - $this->assertEquals( + self::assertEquals( [ new \DateTimeImmutable('2011-10-07', $tz), new \DateTimeImmutable('2014-08-07', $tz), diff --git a/tests/VObject/Recur/EventIterator/MissingOverriddenTest.php b/tests/VObject/Recur/EventIterator/MissingOverriddenTest.php index f848412e..2b1656ec 100644 --- a/tests/VObject/Recur/EventIterator/MissingOverriddenTest.php +++ b/tests/VObject/Recur/EventIterator/MissingOverriddenTest.php @@ -33,7 +33,7 @@ public function testExpand(): void ICS; $vcal = Reader::read($input); - $this->assertInstanceOf(VCalendar::class, $vcal); + self::assertInstanceOf(VCalendar::class, $vcal); $vcal = $vcal->expand(new \DateTime('2011-01-01'), new \DateTime('2015-01-01')); @@ -56,6 +56,6 @@ public function testExpand(): void END:VEVENT END:VCALENDAR ICS; - $this->assertVObjectEqualsVObject($output, $vcal); + self::assertVObjectEqualsVObject($output, $vcal); } } diff --git a/tests/VObject/Recur/EventIterator/NoInstancesTest.php b/tests/VObject/Recur/EventIterator/NoInstancesTest.php index 329543b7..1eff5f94 100644 --- a/tests/VObject/Recur/EventIterator/NoInstancesTest.php +++ b/tests/VObject/Recur/EventIterator/NoInstancesTest.php @@ -32,7 +32,7 @@ public function testRecurrence(): void ICS; $vcal = Reader::read($input); - $this->assertInstanceOf(VCalendar::class, $vcal); + self::assertInstanceOf(VCalendar::class, $vcal); new EventIterator($vcal, 'foo'); } diff --git a/tests/VObject/Recur/EventIterator/OverrideDurationTest.php b/tests/VObject/Recur/EventIterator/OverrideDurationTest.php index da492abb..8162a614 100644 --- a/tests/VObject/Recur/EventIterator/OverrideDurationTest.php +++ b/tests/VObject/Recur/EventIterator/OverrideDurationTest.php @@ -34,19 +34,19 @@ public function testOverrideDuration(): void $vCalendar = Reader::read($ics); $eventIterator = new EventIterator($vCalendar->getComponents()); - $this->assertEquals('2021-05-17 09:00:00', $eventIterator->current()->format('Y-m-d H:i:s'), 'recur event start time'); - $this->assertEquals('2021-05-17 10:00:00', $eventIterator->getDtEnd()->format('Y-m-d H:i:s'), 'recur event end time'); + self::assertEquals('2021-05-17 09:00:00', $eventIterator->current()->format('Y-m-d H:i:s'), 'recur event start time'); + self::assertEquals('2021-05-17 10:00:00', $eventIterator->getDtEnd()->format('Y-m-d H:i:s'), 'recur event end time'); $eventIterator->next(); - $this->assertEquals('2021-05-18 09:00:00', $eventIterator->current()->format('Y-m-d H:i:s'), 'recur event start time'); - $this->assertEquals('2021-05-18 10:00:00', $eventIterator->getDtEnd()->format('Y-m-d H:i:s'), 'recur event end time'); + self::assertEquals('2021-05-18 09:00:00', $eventIterator->current()->format('Y-m-d H:i:s'), 'recur event start time'); + self::assertEquals('2021-05-18 10:00:00', $eventIterator->getDtEnd()->format('Y-m-d H:i:s'), 'recur event end time'); $eventIterator->next(); - $this->assertEquals('2021-05-19 09:00:00', $eventIterator->current()->format('Y-m-d H:i:s'), 'overridden event start time'); - $this->assertEquals('2021-05-19 12:00:00', $eventIterator->getDtEnd()->format('Y-m-d H:i:s'), 'overridden event end time'); + self::assertEquals('2021-05-19 09:00:00', $eventIterator->current()->format('Y-m-d H:i:s'), 'overridden event start time'); + self::assertEquals('2021-05-19 12:00:00', $eventIterator->getDtEnd()->format('Y-m-d H:i:s'), 'overridden event end time'); $eventIterator->next(); - $this->assertEquals('2021-05-20 09:00:00', $eventIterator->current()->format('Y-m-d H:i:s'), 'recur event start time'); - $this->assertEquals('2021-05-20 10:00:00', $eventIterator->getDtEnd()->format('Y-m-d H:i:s'), 'recur event end time'); + self::assertEquals('2021-05-20 09:00:00', $eventIterator->current()->format('Y-m-d H:i:s'), 'recur event start time'); + self::assertEquals('2021-05-20 10:00:00', $eventIterator->getDtEnd()->format('Y-m-d H:i:s'), 'recur event end time'); } } diff --git a/tests/VObject/Recur/EventIterator/OverrideFirstEventTest.php b/tests/VObject/Recur/EventIterator/OverrideFirstEventTest.php index 53914a65..15c92f04 100644 --- a/tests/VObject/Recur/EventIterator/OverrideFirstEventTest.php +++ b/tests/VObject/Recur/EventIterator/OverrideFirstEventTest.php @@ -68,7 +68,7 @@ public function testOverrideFirstEvent(): void END:VCALENDAR ICS; - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $expected, $vcal ); @@ -110,7 +110,7 @@ public function testRemoveFirstEvent(): void END:VCALENDAR ICS; - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $expected, $vcal ); diff --git a/tests/VObject/Recur/EventIterator/SameDateForRecurringEventsTest.php b/tests/VObject/Recur/EventIterator/SameDateForRecurringEventsTest.php index 64b477c2..ef3ed9b1 100644 --- a/tests/VObject/Recur/EventIterator/SameDateForRecurringEventsTest.php +++ b/tests/VObject/Recur/EventIterator/SameDateForRecurringEventsTest.php @@ -51,6 +51,6 @@ public function testAllEventsArePresentInIterator(): void $vCalendar = Reader::read($ics); $eventIterator = new EventIterator($vCalendar->getComponents()); - $this->assertEquals(4, iterator_count($eventIterator), 'in ICS 4 events'); + self::assertEquals(4, iterator_count($eventIterator), 'in ICS 4 events'); } } diff --git a/tests/VObject/Recur/RDateIteratorTest.php b/tests/VObject/Recur/RDateIteratorTest.php index 56c75fb6..5dfe5738 100644 --- a/tests/VObject/Recur/RDateIteratorTest.php +++ b/tests/VObject/Recur/RDateIteratorTest.php @@ -17,12 +17,12 @@ public function testSimple(): void new \DateTimeImmutable('2014-10-01 00:00:00', $utc), ]; - $this->assertEquals( + self::assertEquals( $expected, iterator_to_array($it) ); - $this->assertFalse($it->isInfinite()); + self::assertFalse($it->isInfinite()); } public function testTimezone(): void @@ -36,12 +36,12 @@ public function testTimezone(): void new \DateTimeImmutable('2014-10-01 00:00:00', $tz), ]; - $this->assertEquals( + self::assertEquals( $expected, iterator_to_array($it) ); - $this->assertFalse($it->isInfinite()); + self::assertFalse($it->isInfinite()); } public function testFastForward(): void @@ -62,11 +62,11 @@ public function testFastForward(): void new \DateTimeImmutable('2014-10-01 00:00:00', $utc), ]; - $this->assertEquals( + self::assertEquals( $expected, $result ); - $this->assertFalse($it->isInfinite()); + self::assertFalse($it->isInfinite()); } } diff --git a/tests/VObject/Recur/RRuleIteratorTest.php b/tests/VObject/Recur/RRuleIteratorTest.php index 04b636e7..2814df66 100644 --- a/tests/VObject/Recur/RRuleIteratorTest.php +++ b/tests/VObject/Recur/RRuleIteratorTest.php @@ -573,7 +573,7 @@ public function testYearlyByYearDayImmutable(): void $parser->next(); $item = $parser->current(); - $this->assertEquals('2013-07-09 03:07:00', $item->format('Y-m-d H:i:s')); + self::assertEquals('2013-07-09 03:07:00', $item->format('Y-m-d H:i:s')); } public function testYearlyByYearDayMultiple(): void @@ -1051,22 +1051,22 @@ public function testIteratorFunctions(): void { $parser = new RRuleIterator('FREQ=DAILY', new \DateTime('2014-08-02 00:00:13')); $parser->next(); - $this->assertEquals( + self::assertEquals( new \DateTime('2014-08-03 00:00:13'), $parser->current() ); - $this->assertEquals( + self::assertEquals( 1, $parser->key() ); $parser->rewind(); - $this->assertEquals( + self::assertEquals( new \DateTime('2014-08-02 00:00:13'), $parser->current() ); - $this->assertEquals( + self::assertEquals( 0, $parser->key() ); @@ -1092,7 +1092,7 @@ public function parse($rule, string $start, array $expected, string $fastForward $parser->next(); } - $this->assertEquals( + self::assertEquals( $expected, $result ); diff --git a/tests/VObject/SlashRTest.php b/tests/VObject/SlashRTest.php index 81ab87df..8f968d3c 100644 --- a/tests/VObject/SlashRTest.php +++ b/tests/VObject/SlashRTest.php @@ -14,6 +14,6 @@ public function testEncode(): void { $vcal = new Component\VCalendar(); $prop = $vcal->add('test', "abc\r\ndef"); - $this->assertEquals("TEST:abc\\ndef\r\n", $prop->serialize()); + self::assertEquals("TEST:abc\\ndef\r\n", $prop->serialize()); } } diff --git a/tests/VObject/Splitter/ICalendarTest.php b/tests/VObject/Splitter/ICalendarTest.php index fbef506c..f5428e93 100644 --- a/tests/VObject/Splitter/ICalendarTest.php +++ b/tests/VObject/Splitter/ICalendarTest.php @@ -43,7 +43,7 @@ public function testICalendarImportValidEvent(): void while ($object = $objects->getNext()) { $return .= $object->serialize(); } - $this->assertEquals([], VObject\Reader::read($return)->validate()); + self::assertEquals([], VObject\Reader::read($return)->validate()); } public function testICalendarImportWrongType(): void @@ -80,7 +80,7 @@ public function testICalendarImportEndOfData(): void while ($object = $objects->getNext()) { $return .= $object->serialize(); } - $this->assertNull($objects->getNext()); + self::assertNull($objects->getNext()); } public function testICalendarImportInvalidEvent(): void @@ -136,10 +136,10 @@ public function testICalendarImportMultipleValidEvents(): void $return .= $object->serialize(); $expected = str_replace("\n", "\r\n", $expected); - $this->assertEquals($expected, $object->serialize()); + self::assertEquals($expected, $object->serialize()); ++$i; } - $this->assertEquals([], VObject\Reader::read($return)->validate()); + self::assertEquals([], VObject\Reader::read($return)->validate()); } public function testICalendarImportEventWithoutUID(): void @@ -174,7 +174,7 @@ function ($item) { return $item['message']; }, ); $this->fail('Validation errors: '.implode("\n", $messages)); } else { - $this->assertEquals([], $messages); + self::assertEquals([], $messages); } } @@ -269,12 +269,12 @@ public function testICalendarImportMultipleVTIMEZONESAndMultipleValidEvents(): v EOT; $expected = str_replace("\n", "\r\n", $expected); - $this->assertEquals($expected, $object->serialize()); + self::assertEquals($expected, $object->serialize()); $return .= $object->serialize(); ++$i; } - $this->assertEquals([], VObject\Reader::read($return)->validate()); + self::assertEquals([], VObject\Reader::read($return)->validate()); } public function testICalendarImportWithOutVTIMEZONES(): void @@ -315,6 +315,6 @@ public function testICalendarImportWithOutVTIMEZONES(): void } $messages = VObject\Reader::read($return)->validate(); - $this->assertEquals([], $messages); + self::assertEquals([], $messages); } } diff --git a/tests/VObject/Splitter/VCardTest.php b/tests/VObject/Splitter/VCardTest.php index 11194d66..7ebb07b9 100644 --- a/tests/VObject/Splitter/VCardTest.php +++ b/tests/VObject/Splitter/VCardTest.php @@ -31,7 +31,7 @@ public function testVCardImportValidVCard(): void while ($objects->getNext()) { ++$count; } - $this->assertEquals(1, $count); + self::assertEquals(1, $count); } public function testVCardImportWrongType(): void @@ -96,7 +96,7 @@ public function testVCardImportValidVCardsWithCategories(): void while ($splitter->getNext()) { ++$count; } - $this->assertEquals(4, $count); + self::assertEquals(4, $count); } public function testVCardImportVCardNoComponent(): void @@ -140,7 +140,7 @@ public function testVCardImportQuotedPrintableOptionForgivingLeading(): void while ($splitter->getNext()) { ++$count; } - $this->assertEquals(2, $count); + self::assertEquals(2, $count); } public function testVCardImportEndOfData(): void @@ -155,7 +155,7 @@ public function testVCardImportEndOfData(): void $objects = new VCard($tempFile); $objects->getNext(); - $this->assertNull($objects->getNext()); + self::assertNull($objects->getNext()); } public function testVCardImportCheckInvalidArgumentException(): void @@ -190,7 +190,7 @@ public function testVCardImportMultipleValidVCards(): void while ($objects->getNext()) { ++$count; } - $this->assertEquals(2, $count); + self::assertEquals(2, $count); } public function testImportMultipleSeparatedWithNewLines(): void @@ -214,7 +214,7 @@ public function testImportMultipleSeparatedWithNewLines(): void while ($objects->getNext()) { ++$count; } - $this->assertEquals(2, $count); + self::assertEquals(2, $count); } public function testVCardImportVCardWithoutUID(): void @@ -232,6 +232,6 @@ public function testVCardImportVCardWithoutUID(): void ++$count; } - $this->assertEquals(1, $count); + self::assertEquals(1, $count); } } diff --git a/tests/VObject/StringUtilTest.php b/tests/VObject/StringUtilTest.php index 4dd8bab7..6d6b9b05 100644 --- a/tests/VObject/StringUtilTest.php +++ b/tests/VObject/StringUtilTest.php @@ -10,21 +10,21 @@ public function testNonUTF8(): void { $string = StringUtil::isUTF8(chr(0xBF)); - $this->assertEquals(false, $string); + self::assertEquals(false, $string); } public function testIsUTF8(): void { $string = StringUtil::isUTF8('I 💚 SabreDAV'); - $this->assertEquals(true, $string); + self::assertEquals(true, $string); } public function testUTF8ControlChar(): void { $string = StringUtil::isUTF8(chr(0x00)); - $this->assertEquals(false, $string); + self::assertEquals(false, $string); } public function testConvertToUTF8nonUTF8(): void @@ -32,20 +32,20 @@ public function testConvertToUTF8nonUTF8(): void // 0xBF is an ASCII upside-down question mark $string = StringUtil::convertToUTF8(chr(0xBF)); - $this->assertEquals(mb_convert_encoding(chr(0xBF), 'UTF-8', 'ISO-8859-1'), $string); + self::assertEquals(mb_convert_encoding(chr(0xBF), 'UTF-8', 'ISO-8859-1'), $string); } public function testConvertToUTF8IsUTF8(): void { $string = StringUtil::convertToUTF8('I 💚 SabreDAV'); - $this->assertEquals('I 💚 SabreDAV', $string); + self::assertEquals('I 💚 SabreDAV', $string); } public function testConvertToUTF8ControlChar(): void { $string = StringUtil::convertToUTF8(chr(0x00)); - $this->assertEquals('', $string); + self::assertEquals('', $string); } } diff --git a/tests/VObject/TimeZoneUtilTest.php b/tests/VObject/TimeZoneUtilTest.php index 2b53fa9d..462218e9 100644 --- a/tests/VObject/TimeZoneUtilTest.php +++ b/tests/VObject/TimeZoneUtilTest.php @@ -18,7 +18,7 @@ public function testCorrectTZ(string $timezoneName): void { try { $tz = new \DateTimeZone($timezoneName); - $this->assertInstanceOf('DateTimeZone', $tz); + self::assertInstanceOf('DateTimeZone', $tz); } catch (\Exception $e) { if (false !== strpos($e->getMessage(), 'Unknown or bad timezone')) { $this->markTestSkipped($timezoneName.' is not (yet) supported in this PHP version. Update pecl/timezonedb'); @@ -83,7 +83,7 @@ public function testExchangeMap(): void $tz = TimeZoneUtil::getTimeZone('foo', Reader::read($vobj)); $ex = new \DateTimeZone('Europe/Lisbon'); - $this->assertEquals($ex->getName(), $tz->getName()); + self::assertEquals($ex->getName(), $tz->getName()); } public function testWhetherMicrosoftIsStillInsane(): void @@ -108,7 +108,7 @@ public function testWhetherMicrosoftIsStillInsane(): void $tz = TimeZoneUtil::getTimeZone('(GMT+01.00) Sarajevo/Warsaw/Zagreb', Reader::read($vobj)); $ex = new \DateTimeZone('Europe/Sarajevo'); - $this->assertEquals($ex->getName(), $tz->getName()); + self::assertEquals($ex->getName(), $tz->getName()); } public function testUnknownExchangeId(): void @@ -148,21 +148,21 @@ public function testUnknownExchangeId(): void $tz = TimeZoneUtil::getTimeZone('foo', Reader::read($vobj)); $ex = new \DateTimeZone(date_default_timezone_get()); - $this->assertEquals($ex->getName(), $tz->getName()); + self::assertEquals($ex->getName(), $tz->getName()); } public function testEmptyTimeZone(): void { $tz = TimeZoneUtil::getTimeZone(''); $ex = new \DateTimeZone('UTC'); - $this->assertEquals($ex->getName(), $tz->getName()); + self::assertEquals($ex->getName(), $tz->getName()); } public function testWindowsTimeZone(): void { $tz = TimeZoneUtil::getTimeZone('Eastern Standard Time'); $ex = new \DateTimeZone('America/New_York'); - $this->assertEquals($ex->getName(), $tz->getName()); + self::assertEquals($ex->getName(), $tz->getName()); } /** @@ -173,7 +173,7 @@ public function testTimeZoneIdentifiers(string $tzid): void $tz = TimeZoneUtil::getTimeZone($tzid); $ex = new \DateTimeZone($tzid); - $this->assertEquals($ex->getName(), $tz->getName()); + self::assertEquals($ex->getName(), $tz->getName()); } /** @@ -195,7 +195,7 @@ public function testTimeZoneBCIdentifiers(string $tzid): void $tz = TimeZoneUtil::getTimeZone($tzid); $ex = new \DateTimeZone($tzid); - $this->assertEquals($ex->getName(), $tz->getName()); + self::assertEquals($ex->getName(), $tz->getName()); } public function getPHPTimeZoneIdentifiers(): array @@ -229,7 +229,7 @@ public function testTimezoneOffset(): void } else { $ex = new \DateTimeZone('Etc/GMT-4'); } - $this->assertEquals($ex->getName(), $tz->getName()); + self::assertEquals($ex->getName(), $tz->getName()); } public function testTimezoneFail(): void @@ -273,7 +273,7 @@ public function testFallBack(): void $tz = TimeZoneUtil::getTimeZone('foo', Reader::read($vobj)); $ex = new \DateTimeZone(date_default_timezone_get()); - $this->assertEquals($ex->getName(), $tz->getName()); + self::assertEquals($ex->getName(), $tz->getName()); } public function testLjubljanaBug(): void @@ -319,7 +319,7 @@ public function testLjubljanaBug(): void $tz = TimeZoneUtil::getTimeZone('/freeassociation.sourceforge.net/Tzfile/Europe/Ljubljana', Reader::read($vobj)); $ex = new \DateTimeZone('Europe/Ljubljana'); - $this->assertEquals($ex->getName(), $tz->getName()); + self::assertEquals($ex->getName(), $tz->getName()); } public function testWeirdSystemVLICs(): void @@ -367,13 +367,13 @@ public function testWeirdSystemVLICs(): void $tz = TimeZoneUtil::getTimeZone('/freeassociation.sourceforge.net/Tzfile/SystemV/EST5EDT', Reader::read($vobj), true); $ex = new \DateTimeZone('America/New_York'); - $this->assertEquals($ex->getName(), $tz->getName()); + self::assertEquals($ex->getName(), $tz->getName()); } public function testPrefixedOffsetExchangeIdentifier(): void { $tz = TimeZoneUtil::getTimeZone('(UTC-05:00) Eastern Time (US & Canada)'); $ex = new \DateTimeZone('America/New_York'); - $this->assertEquals($ex->getName(), $tz->getName()); + self::assertEquals($ex->getName(), $tz->getName()); } } diff --git a/tests/VObject/UUIDUtilTest.php b/tests/VObject/UUIDUtilTest.php index e792c454..170107b3 100644 --- a/tests/VObject/UUIDUtilTest.php +++ b/tests/VObject/UUIDUtilTest.php @@ -8,16 +8,16 @@ class UUIDUtilTest extends TestCase { public function testValidateUUID(): void { - $this->assertTrue( + self::assertTrue( UUIDUtil::validateUUID('11111111-2222-3333-4444-555555555555') ); - $this->assertFalse( + self::assertFalse( UUIDUtil::validateUUID(' 11111111-2222-3333-4444-555555555555') ); - $this->assertTrue( + self::assertTrue( UUIDUtil::validateUUID('ffffffff-2222-3333-4444-555555555555') ); - $this->assertFalse( + self::assertFalse( UUIDUtil::validateUUID('fffffffg-2222-3333-4444-555555555555') ); } @@ -27,7 +27,7 @@ public function testValidateUUID(): void */ public function testGetUUID(): void { - $this->assertTrue( + self::assertTrue( UUIDUtil::validateUUID( UUIDUtil::getUUID() ) diff --git a/tests/VObject/VCard21Test.php b/tests/VObject/VCard21Test.php index 16ee46a6..d091e35d 100644 --- a/tests/VObject/VCard21Test.php +++ b/tests/VObject/VCard21Test.php @@ -22,7 +22,7 @@ public function testPropertyWithNoName(): void $vobj = Reader::read($input); $output = $vobj->serialize(); - $this->assertEquals($input, $output); + self::assertEquals($input, $output); } public function testPropertyPadValueCount(): void @@ -46,6 +46,6 @@ public function testPropertyPadValueCount(): void VCF; - $this->assertEquals($expected, $output); + self::assertEquals($expected, $output); } } diff --git a/tests/VObject/VCardConverterTest.php b/tests/VObject/VCardConverterTest.php index 7af60b7b..9db0ad56 100644 --- a/tests/VObject/VCardConverterTest.php +++ b/tests/VObject/VCardConverterTest.php @@ -49,7 +49,7 @@ public function testConvert30to40(): void $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD40); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $output, $vcard ); @@ -90,7 +90,7 @@ public function testConvert40to40(): void $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD40); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $output, $vcard ); @@ -132,7 +132,7 @@ public function testConvert21to40(): void $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD40); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $output, $vcard ); @@ -175,7 +175,7 @@ public function testConvert30to30(): void $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD30); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $output, $vcard ); @@ -219,7 +219,7 @@ public function testConvert40to30(): void $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD30); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $output, $vcard ); @@ -255,7 +255,7 @@ public function testConvertGroupCard(): void $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD40); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $output, $vcard ); @@ -275,7 +275,7 @@ public function testConvertGroupCard(): void $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD30); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $output, $vcard ); @@ -307,7 +307,7 @@ public function testBDAYConversion() $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD40); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $output, $vcard ); @@ -325,7 +325,7 @@ public function testBDAYConversion() $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD30); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $output, $vcard ); @@ -403,7 +403,7 @@ public function testConvertIndividualCard(): void $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD30); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $output, $vcard ); @@ -420,7 +420,7 @@ public function testConvertIndividualCard(): void $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD40); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $output, $vcard ); @@ -453,7 +453,7 @@ public function testAnniversary(): void $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD30); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $output, $vcard ); @@ -471,7 +471,7 @@ public function testAnniversary(): void $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD40); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $output, $vcard ); @@ -512,7 +512,7 @@ public function testMultipleAnniversaries(): void $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD30); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $output, $vcard ); @@ -530,7 +530,7 @@ public function testMultipleAnniversaries(): void $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD40); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $output, $vcard ); @@ -554,7 +554,7 @@ public function testNoLabel(): void $vcard = Reader::read($input); - $this->assertInstanceOf(Component\VCard::class, $vcard); + self::assertInstanceOf(Component\VCard::class, $vcard); /** @var VCard $vcard */ $vcard = $vcard->convert(Document::VCARD40); $vcard = $vcard->serialize(); @@ -577,7 +577,7 @@ public function testNoLabel(): void VCF; - $this->assertEquals($expected, str_replace("\r", '', $vcard)); + self::assertEquals($expected, str_replace("\r", '', $vcard)); } /** @@ -608,7 +608,7 @@ public function testPhoneNumberValueTypeGetsRemoved(): void $vcard = Reader::read($input); $vcard = $vcard->convert(Document::VCARD40); - $this->assertVObjectEqualsVObject( + self::assertVObjectEqualsVObject( $output, $vcard ); diff --git a/tests/VObject/VersionTest.php b/tests/VObject/VersionTest.php index 9e18b45e..f2f240eb 100644 --- a/tests/VObject/VersionTest.php +++ b/tests/VObject/VersionTest.php @@ -9,6 +9,6 @@ class VersionTest extends TestCase public function testString(): void { $v = Version::VERSION; - $this->assertEquals(-1, version_compare('2.0.0', $v)); + self::assertEquals(-1, version_compare('2.0.0', $v)); } } diff --git a/tests/VObject/WriterTest.php b/tests/VObject/WriterTest.php index 42cde6a9..f5cd7a69 100644 --- a/tests/VObject/WriterTest.php +++ b/tests/VObject/WriterTest.php @@ -16,19 +16,19 @@ public function getComponent(): ?Document public function testWriteToMimeDir(): void { $result = Writer::write($this->getComponent()); - $this->assertEquals("BEGIN:VCALENDAR\r\nEND:VCALENDAR\r\n", $result); + self::assertEquals("BEGIN:VCALENDAR\r\nEND:VCALENDAR\r\n", $result); } public function testWriteToJson(): void { $result = Writer::writeJson($this->getComponent()); - $this->assertEquals('["vcalendar",[],[]]', $result); + self::assertEquals('["vcalendar",[],[]]', $result); } public function testWriteToXml(): void { $result = Writer::writeXml($this->getComponent()); - $this->assertEquals( + self::assertEquals( ''."\n". ''."\n". ' '."\n".