function it_handles_static_constructors() { $player = new ReflectionBased(); $product = $player->replay(new \ArrayIterator([new Generic('HasBeenStaticallyConstructed', ['test'])]), Product::class); expect($product)->toBeLike(Product::fromString('test')); }
function it_uses_apply_methods_if_as_a_fallback() { $player = new ReflectionBased(); $product = $player->replay(new \ArrayIterator([new Generic('HasBeenCreated', ['test'])]), ProductWithApply::class); expect($product->name)->toBe('test'); }