Ejemplo n.º 1
0
 public function testUpperCaseFirst()
 {
     $upperCase = _String::ucfirst();
     $data = 'agasg4';
     $this->assertInstanceOf(StringUpperCaseFirst::class, $upperCase);
     $this->assertInstanceOf(AbstractStringNode::class, $upperCase);
     $this->assertEquals('Agasg4', $upperCase($data));
 }
Ejemplo n.º 2
0
 public function testMapNode()
 {
     $before = _Array::map(_String::ucfirst());
     $this->assertInstanceOf(ArrayMap::class, $before);
     $this->assertInstanceOf(CollectionNodeInterface::class, $before);
     $this->assertInstanceOf(AbstractArray::class, $before);
     $this->assertInstanceOf(AbstractNode::class, $before);
     $this->assertEquals($before(['a.b'])[0], 'A.b');
 }
Ejemplo n.º 3
0
 /**
  * @return AbstractStringNode
  */
 public function ucfirst()
 {
     return $this->then(_String::ucfirst());
 }
Ejemplo n.º 4
0
 public function testChain()
 {
     $data = 'abc-acdc-acab';
     $chain = _Array::explode('-')->map(_String::ucfirst()->substring(0, 2))->implode('');
     $this->assertEquals('AbAcAc', $chain($data));
 }