CompatibilityMatrix::allReleased([FakeCapability::Read]); $profile = new Profile( 'fake', 'Fake Plugin', Tier::ReleasePerVersion, [FakeCapability::Read], matrix: $matrix, minVersion: '2.0' ); self::assertSame('fake', $profile->id); self::assertSame('Fake Plugin', $profile->label); self::assertSame(Tier::ReleasePerVersion, $profile->tier); self::assertSame([FakeCapability::Read], $profile->capabilities); self::assertSame($matrix, $profile->matrix); self::assertSame('2.0', $profile->minVersion); self::assertSame([], $profile->manifests); } public function testAReleasePerVersionProfileWithoutMatrixIsAProgrammingError(): void { $this->expectException(LogicException::class); $this->expectExceptionMessage('needs a matrix closure'); new Profile('fake', 'Fake', Tier::ReleasePerVersion, [FakeCapability::Read]); } public function testCapabilityIdsMustBeUniqueWithinAProfile(): void { $this->expectException(LogicException::class); $this->expectExceptionMessage('fake-read'); new Profile('fake', 'Fake', Tier::ReportOnly, [FakeCapability::Read, FakeCapability::Read]); } public function testTheTiersHaveStableValues(): void { self::assertSame( ['report', 'lock', 'release'], array_map(static fn (Tier $t): string => $t->value, Tier::cases()) ); } }