/** * @test */ public function example() { $binder = Binder::createSimpleProductionBinder(); $request = $this->createRequest(); $bindResult = $binder->bind($request, \Bindto\Fixtures\DTOCreatePage::class); $this->assertTrue($bindResult->isValid(), $bindResult->getViolations()); }
/** * @test */ public function example() { $binder = Binder::createSimpleProductionBinder(); $request = $this->createRequest(); $bindResult = $binder->bind($request, DTOCreatePage::class); $this->assertTrue($bindResult->isValid(), 'bind result should be valid'); $this->assertEmpty($bindResult->getViolations(), 'violations should be empty'); $this->assertInstanceOf('Bindto\\Fixtures\\DTOCreatePage', $bindResult->getData(), 'we should get back a DTOCreatePage object'); $obj = $bindResult->getData(); $this->assertEquals('my-slug', $obj->title, 'request values should be successfully mapped in resulting object'); }