loadRawSchema($spec); $data = ['valid1', 'valid2', .0]; try { (new SchemaValidator())->validate($data, $schema); } catch (TypeMismatch $e) { $this->assertEquals([2], $e->dataBreadCrumb()->buildChain()); $this->assertEquals($data[2], $e->data()); } } public function testItShowsInvalidDataAddressNested() : void { $spec = <<loadRawSchema($spec); $data = [ [ ['name' => 'good name'], ], [ ['name' => .0], ], ]; try { (new SchemaValidator())->validate($data, $schema); } catch (TypeMismatch $e) { $this->assertEquals([1, 0, 'name'], $e->dataBreadCrumb()->buildChain()); $this->assertEquals($data[1][0]['name'], $e->data()); } } }