8
8
use InvalidArgumentException ;
9
9
use PHPUnit \Framework \TestCase ;
10
10
use RuntimeException ;
11
+ use WordPress \AiClient \Tests \mocks \Enums \InvalidNameTestEnum ;
12
+ use WordPress \AiClient \Tests \mocks \Enums \InvalidTypeTestEnum ;
13
+ use WordPress \AiClient \Tests \mocks \Enums \ValidTestEnum ;
11
14
12
15
/**
13
16
* @covers \WordPress\AiClient\Common\AbstractEnum
@@ -32,7 +35,7 @@ public function testFromWithValidValue(): void
32
35
public function testFromWithInvalidValueThrowsException (): void
33
36
{
34
37
$ this ->expectException (InvalidArgumentException::class);
35
- $ this ->expectExceptionMessage ('invalid is not a valid backing value for enum WordPress\AiClient\Tests\unit\Common \ValidTestEnum ' );
38
+ $ this ->expectExceptionMessage ('invalid is not a valid backing value for enum WordPress\AiClient\Tests\mocks\Enums \ValidTestEnum ' );
36
39
ValidTestEnum::from ('invalid ' );
37
40
}
38
41
@@ -106,7 +109,7 @@ public function testInvalidStaticMethodThrowsException(): void
106
109
{
107
110
$ this ->expectException (BadMethodCallException::class);
108
111
$ this ->expectExceptionMessage (
109
- 'Method WordPress\AiClient\Tests\unit\Common \ValidTestEnum::invalidMethod does not exist '
112
+ 'Method WordPress\AiClient\Tests\mocks\Enums \ValidTestEnum::invalidMethod does not exist '
110
113
);
111
114
ValidTestEnum::invalidMethod ();
112
115
}
@@ -131,7 +134,7 @@ public function testInvalidIsMethodThrowsException(): void
131
134
132
135
$ this ->expectException (BadMethodCallException::class);
133
136
$ this ->expectExceptionMessage (
134
- 'Method WordPress\AiClient\Tests\unit\Common \ValidTestEnum::isInvalidMethod does not exist '
137
+ 'Method WordPress\AiClient\Tests\mocks\Enums \ValidTestEnum::isInvalidMethod does not exist '
135
138
);
136
139
$ enum ->isInvalidMethod ();
137
140
}
@@ -196,7 +199,7 @@ public function testPropertiesAreReadOnly(): void
196
199
197
200
$ this ->expectException (BadMethodCallException::class);
198
201
$ this ->expectExceptionMessage (
199
- 'Cannot modify property WordPress\AiClient\Tests\unit\Common \ValidTestEnum::value - enum properties are read-only '
202
+ 'Cannot modify property WordPress\AiClient\Tests\mocks\Enums \ValidTestEnum::value - enum properties are read-only '
200
203
);
201
204
$ enum ->value = 'modified ' ;
202
205
}
@@ -210,7 +213,7 @@ public function testInvalidPropertyAccessThrowsException(): void
210
213
211
214
$ this ->expectException (BadMethodCallException::class);
212
215
$ this ->expectExceptionMessage (
213
- 'Property WordPress\AiClient\Tests\unit\Common \ValidTestEnum::invalid does not exist '
216
+ 'Property WordPress\AiClient\Tests\mocks\Enums \ValidTestEnum::invalid does not exist '
214
217
);
215
218
$ enum ->invalid ;
216
219
}
@@ -233,7 +236,7 @@ public function testInvalidConstantNameThrowsException(): void
233
236
$ this ->expectException (RuntimeException::class);
234
237
$ this ->expectExceptionMessage (
235
238
'Invalid enum constant name "invalid_name" in ' .
236
- 'WordPress\AiClient\Tests\unit\Common \InvalidNameTestEnum. Constants must be UPPER_SNAKE_CASE. '
239
+ 'WordPress\AiClient\Tests\mocks\Enums \InvalidNameTestEnum. Constants must be UPPER_SNAKE_CASE. '
237
240
);
238
241
239
242
InvalidNameTestEnum::cases ();
@@ -247,7 +250,7 @@ public function testInvalidConstantTypeThrowsException(): void
247
250
$ this ->expectException (RuntimeException::class);
248
251
$ this ->expectExceptionMessage (
249
252
'Invalid enum value type for constant ' .
250
- 'WordPress\AiClient\Tests\unit\Common \InvalidTypeTestEnum::INT_VALUE. ' .
253
+ 'WordPress\AiClient\Tests\mocks\Enums \InvalidTypeTestEnum::INT_VALUE. ' .
251
254
'Only string values are allowed, integer given. '
252
255
);
253
256
0 commit comments