File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -966,6 +966,32 @@ public function testAssertObjectHasAttribute(): void
966966 $ this ->assertObjectHasAttribute ('foo ' , $ o );
967967 }
968968
969+ public function testAssertObjectHasAttributeNumericAttribute (): void
970+ {
971+ $ object = (object ) [
972+ '2016 ' => [
973+ 'hostCity ' => 'Rio ' ,
974+ 'games ' => 'summer ' ,
975+ ],
976+ '2018 ' => [
977+ 'hostCity ' => 'Pyeongchang ' ,
978+ 'games ' => 'winter ' ,
979+ ],
980+ '2020 ' => [
981+ 'hostCity ' => 'Tokyo ' ,
982+ 'games ' => 'summer ' ,
983+ ],
984+ ];
985+
986+ $ this ->assertObjectHasAttribute ('2016 ' , $ object );
987+ $ this ->assertObjectHasAttribute ('2018 ' , $ object );
988+ $ this ->assertObjectHasAttribute ('2020 ' , $ object );
989+
990+ $ this ->expectException (AssertionFailedError::class);
991+
992+ $ this ->assertObjectHasAttribute ('foo ' , $ object );
993+ }
994+
969995 public function testAssertObjectNotHasAttribute (): void
970996 {
971997 $ o = new \Author ('Terry Pratchett ' );
You can’t perform that action at this time.
0 commit comments