File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -351,6 +351,44 @@ public function assertNotChecked($field, $value = null)
351
351
352
352
return $ this ;
353
353
}
354
+
355
+ /**
356
+ * Assert that the given radio field is selected.
357
+ *
358
+ * @param string $field
359
+ * @param string $value
360
+ * @return $this
361
+ */
362
+ function assertRadioSelected ($ field , $ value )
363
+ {
364
+ $ element = $ this ->resolver ->resolveForRadioSelection ($ field , $ value );
365
+
366
+ PHPUnit::assertTrue (
367
+ $ element ->isSelected (),
368
+ "Expected radio [ {$ field }] to be selected, but it wasn't. "
369
+ );
370
+
371
+ return $ this ;
372
+ }
373
+
374
+ /**
375
+ * Assert that the given radio field is not selected.
376
+ *
377
+ * @param string $field
378
+ * @param string $value
379
+ * @return $this
380
+ */
381
+ public function assertRadioNotSelected ($ field , $ value = null )
382
+ {
383
+ $ element = $ this ->resolver ->resolveForRadioSelection ($ field , $ value );
384
+
385
+ PHPUnit::assertFalse (
386
+ $ element ->isSelected (),
387
+ "Radio [ {$ field }] was unexpectedly selected. "
388
+ );
389
+
390
+ return $ this ;
391
+ }
354
392
355
393
/**
356
394
* Assert that the given select field has the given value selected.
You can’t perform that action at this time.
0 commit comments