/** * Test the Joomla\Registry\Registry::append method. * * @return void * * @covers Joomla\Registry\Registry::append * @since 1.0 */ public function testAppend() { $a = new Registry(); $a->set('foo', array('var1', 'var2', 'var3')); $a->append('foo', 'var4'); $this->assertThat($a->get('foo.3'), $this->equalTo('var4'), 'Line: ' . __LINE__ . '.'); $b = $a->get('foo'); $this->assertTrue(is_array($b)); $b[] = 'var5'; $this->assertNull($a->get('foo.4')); }
/** * @testdox A key is appended to a nested path * * @covers Joomla\Registry\Registry::append */ public function testAKeyIsAppendedToANestedPath() { $a = new Registry(array('foo' => array('var1', 'var2', 'var3'))); $a->append('foo', 'var4'); $this->assertSame('var4', $a->get('foo.3'), 'A key is appended to a nested path.'); }