public function setup() { $reconstitute = new ReconstituteUsingInstantiatorAndHydrator(new Instantiator(), new HydrateUsingReflection()); // test run, for calibration $reconstitute->objectFrom(SerializableClassUsingTrait::class, []); $reconstitute->objectFrom(SomeOtherSerializableClassUsingTrait::class, []); Reconstitution::reconstituteUsing($reconstitute); }
/** * @test */ public function it_properly_configures_the_reconstitute_service() { // reset previous state Reconstitution::reconstituteUsing(null); $kernel = $this->createKernel(); $kernel->boot(); $this->assertSame($kernel->getContainer()->get('broadway_serialization.reconstitute'), Reconstitution::reconstitute()); }
protected function classSetUp() { $this->traditionalSerializableClass = new TraditionalSerializableClass(); $this->serializableClassUsingTrait = new SerializableClassUsingTrait(); $reconstitute = new ReconstituteUsingInstantiatorAndHydrator(new Instantiator(), new HydrateUsingReflection()); // test run, for calibration $reconstitute->objectFrom('BroadwaySerialization\\Test\\Performance\\SerializableClassUsingTrait', []); $reconstitute->objectFrom('\\BroadwaySerialization\\Test\\Performance\\SomeOtherSerializableClassUsingTrait', []); Reconstitution::reconstituteUsing($reconstitute); }
/** * Bootstrap the event bus * * @return void */ public function boot() { $eventBus = $this->app->make(EventBusInterface::class); // The projections config contains a list of class names or projectors. // Each of these projectors will be subscribed to the given event bus. $projectors = $this->app->config->get('event_sourcing.projectors'); foreach ($projectors as $projector) { $eventBus->subscribe($this->app->make($projector)); } Reconstitution::reconstituteUsing(new ReconstituteUsingInstantiatorAndHydrator(new Instantiator(), new HydrateUsingReflection())); }
/** * @before */ public function setupSomeFixtures() { Reconstitution::reconstituteUsing(new ReconstituteUsingInstantiatorAndHydrator(new Instantiator(), new HydrateUsingReflection())); }
public function boot() { Reconstitution::reconstituteUsing($this->container->get('broadway_serialization.reconstitute')); }
protected function setUp() { Reconstitution::reconstituteUsing(new ReconstituteUsingInstantiatorAndHydrator(new Instantiator(), new HydrateUsingReflection())); }
protected function setUp() { parent::setUp(); // Not 100% sure if this belongs here or in the implementations Reconstitution::reconstituteUsing(new ReconstituteUsingInstantiatorAndHydrator(new Instantiator(), new HydrateUsingReflection())); }
/** * @test */ public function it_returns_the_previously_provided_reconstitute_object() { $reconstitute = $this->dummyReconstitute(); Reconstitution::reconstituteUsing($reconstitute); $this->assertSame($reconstitute, Reconstitution::reconstitute()); }
/** * @see \Broadway\Serializer\SerializableInterface::deserialize() * * @param array $data * @return object of type static::class */ public static final function deserialize(array $data) { return Reconstitution::reconstitute()->objectFrom(get_called_class(), RecursiveSerializer::deserialize($data, self::deserializationCallbacks())); }
/** * Register the service provider. * * @return void */ public function register() { Reconstitution::reconstituteUsing(new ReconstituteUsingInstantiatorAndHydrator(new Instantiator(), new HydrateUsingReflection())); }