function _property($key)
{
    return Underscore::property($key);
}
Ejemplo n.º 2
0
 /**
  * @tags objects
  */
 public function testProperty()
 {
     $fn = _::property('prop');
     $this->integer($fn(['prop' => 1]))->isEqualTo(1);
     $this->integer($fn((object) ['prop' => 2]))->isEqualTo(2);
     $this->integer($fn(new \ArrayIterator(['prop' => 3])))->isEqualTo(3);
     $this->variable($fn((object) []))->isNull();
 }