public function testImplode() { $implode = \Hurl\Node\Statics\_Array::implode('.'); $data = ['a', 'b', 'c']; $this->assertInstanceOf(ArrayImplode::class, $implode); $this->assertEquals('a.b.c', $implode($data)); }
public function testCall() { $before = _Array::explode('.'); $after = _Array::implode('-'); $append = $before->then($after); $this->assertEquals($append('a.b'), 'a-b'); $this->assertEquals($before('a.b')[0], 'a'); $this->assertEquals($before('a.b')[1], 'b'); $this->assertEquals($after(['a', 'b']), 'a-b'); }
/** * @param string $glue * @return AbstractNode */ public function implode(string $glue) { return $this->then(_Array::implode($glue)); }