createStub(Category::class); $feature1->method('getSorting')->willReturn(10); $feature2 = $this->createStub(Category::class); $feature2->method('getSorting')->willReturn(5); $storage = new ObjectStorage(); $storage->attach($feature1); $storage->attach($feature2); $subject = new Event(); $subject->_setProperty('features', $storage); self::assertSame([ $feature2, $feature1, ], $subject->getFeatures()); } #[Test] public function returnsEmptyFeaturesStorage(): void { $subject = new Event(); $subject->_setProperty('features', new ObjectStorage()); self::assertSame([], $subject->getFeatures()); } }