示例#1
0
 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));
 }
示例#2
0
 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');
 }
示例#3
0
 /**
  * @param string $glue
  * @return AbstractNode
  */
 public function implode(string $glue)
 {
     return $this->then(_Array::implode($glue));
 }