public function testToIndexString() { $this->assertEquals(TestToIndexString::test((object) array('x' => 1)), 'x_1'); $this->assertEquals(TestToIndexString::test((object) array('x' => -1)), 'x_-1'); $this->assertEquals(TestToIndexString::test((object) array('x' => 1, 'y' => -1)), 'x_1_y_-1'); }
public function testToIndexString() { $this->assertEquals(TestToIndexString::test(null), '_1'); $this->assertEquals(TestToIndexString::test(52), '52_1'); $this->assertEquals(TestToIndexString::test('x'), 'x_1'); $this->assertEquals(TestToIndexString::test('x.y.z'), 'x_y_z_1'); $this->assertEquals(TestToIndexString::test('x_y.z'), 'x_y_z_1'); $this->assertEquals(TestToIndexString::test(array('x' => 1)), 'x_1'); $this->assertEquals(TestToIndexString::test(array('x' => -1)), 'x_-1'); $this->assertEquals(TestToIndexString::test(array('x' => 1, 'y' => -1)), 'x_1_y_-1'); }