You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$this->expectExceptionMessage(sprintf('Collection should only include [%s] items, but \'%s\' found at position %d.', class_basename(newstdClass()), gettype($collection), 3));
5207
5209
$data->ensure(stdClass::class);
5208
5210
}
5209
5211
@@ -5213,8 +5215,10 @@ public function testEnsureForInheritance($collection)
5213
5215
$data = $collection::make([new \Error, new \Error]);
5214
5216
$data->ensure(\Throwable::class);
5215
5217
5216
-
$data = $collection::make([new \Error, new \Error, new$collection]);
5218
+
$wrongType = new$collection;
5219
+
$data = $collection::make([new \Error, new \Error, $wrongType]);
$this->expectExceptionMessage(sprintf("Collection should only include [%s] items, but '%s' found at position %d.", \Throwable::class, get_class($wrongType), 2));
5218
5222
$data->ensure(\Throwable::class);
5219
5223
}
5220
5224
@@ -5224,8 +5228,10 @@ public function testEnsureForMultipleTypes($collection)
5224
5228
$data = $collection::make([new \Error, 123]);
5225
5229
$data->ensure([\Throwable::class, 'int']);
5226
5230
5227
-
$data = $collection::make([new \Error, new \Error, new$collection]);
5231
+
$wrongType = new$collection;
5232
+
$data = $collection::make([new \Error, new \Error, $wrongType]);
$this->expectExceptionMessage(sprintf('Collection should only include [%s] items, but \'%s\' found at position %d.', implode(', ', [\Throwable::class, 'int']), get_class($wrongType), 2));
0 commit comments