has(stdClass::class)); self::assertFalse($attributes->has(DateTimeInterface::class)); } public function test_attributes_of_type_filters_on_given_class_name(): void { $object = new stdClass(); $date = new DateTime(); $attributes = new AttributesContainer($object, $date); $filteredAttributes = $attributes->ofType(DateTimeInterface::class); self::assertContainsEquals($date, $filteredAttributes); self::assertNotContains($object, $filteredAttributes); self::assertSame($date, $filteredAttributes[0]); } }