[], 'baz' => []]); $this->assertEquals(['foo', 'baz'], $sm->getShapeNames()); } public function testEnsuresShapeExists() { $this->expectException(\InvalidArgumentException::class); $sm = new ShapeMap([]); $sm->resolve(['shape' => 'missing']); } public function testReturnsShapes() { $sm = new ShapeMap(['foo' => ['type' => 'string']]); $s = $sm->resolve(['shape' => 'foo']); $this->assertInstanceOf(Shape::class, $s); $this->assertArrayNotHasKey('shape', $s->toArray()); $this->assertSame($s, $sm->resolve(['shape' => 'foo'])); } }