assertSame(CompletionProviderFixture::class, $attribute->provider); $this->assertNull($attribute->values); $this->assertNull($attribute->enum); } public function testCanBeConstructedWithProviderInstance(): void { $instance = new CompletionProviderFixture(); $attribute = new CompletionProvider(provider: $instance); $this->assertSame($instance, $attribute->provider); $this->assertNull($attribute->values); $this->assertNull($attribute->enum); } public function testCanBeConstructedWithValuesArray(): void { $values = ['draft', 'published', 'archived']; $attribute = new CompletionProvider(values: $values); $this->assertNull($attribute->provider); $this->assertSame($values, $attribute->values); $this->assertNull($attribute->enum); } public function testCanBeConstructedWithEnumClass(): void { $attribute = new CompletionProvider(enum: StatusEnum::class); $this->assertNull($attribute->provider); $this->assertNull($attribute->values); $this->assertSame(StatusEnum::class, $attribute->enum); } public function testThrowsExceptionWhenNoParametersProvided(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Only one of provider, values, or enum can be set'); new CompletionProvider(); } public function testThrowsExceptionWhenMultipleParametersProvided(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Only one of provider, values, or enum can be set'); new CompletionProvider( provider: CompletionProviderFixture::class, values: ['test'] ); } public function testThrowsExceptionWhenAllParametersProvided(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Only one of provider, values, or enum can be set'); new CompletionProvider( provider: CompletionProviderFixture::class, values: ['test'], enum: StatusEnum::class ); } }