assertObjectHasProperty($propertyName, $invoice); } public function testJson(): void { $faker = Faker\Factory::create(); $cuota = $this->getMockBuilder(Model\Venta\Cuota::class) ->disableOriginalConstructor()->getMock(); $cuota->id = $faker->randomNumber(); $toku_id = $faker->ean13(); $id = $faker->randomNumber(); $invoice = new Model\Venta\MediosPago\Toku\Invoice(); $invoice->id = $id; $invoice->cuota = $cuota; $invoice->toku_id = $toku_id; $expected = json_encode([ 'id' => $id, 'cuota_id' => $cuota->id, 'toku_id' => $toku_id, ]); $this->assertEquals($expected, json_encode($invoice)); } }