We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 284d4b0 commit b3c3053Copy full SHA for b3c3053
tests/EnumTest.php
@@ -249,6 +249,30 @@ public function testEqualsConflictValues()
249
$this->assertFalse(EnumFixture::FOO()->equals(EnumConflict::FOO()));
250
}
251
252
+ /**
253
+ * fromKey()
254
+ */
255
+ public function testFromKey()
256
+ {
257
+ $number = EnumFixture::BAR();
258
+ $fromValue = EnumFixture::fromKey('BAR');
259
+
260
+ $this->assertSame($number, $fromValue);
261
+ }
262
263
264
+ * fromValue()
265
266
+ public function testFromValue()
267
268
+ $enum = EnumFixture::NUMBER();
269
+ $number = EnumFixture::fromValue(42);
270
+ $inexistant = EnumFixture::fromValue('inexistant');
271
272
+ $this->assertSame($enum, $number);
273
+ $this->assertSame(null, $inexistant);
274
275
276
/**
277
* __wakeup()
278
*/
0 commit comments