コード例 #1
0
function _property($key)
{
    return Underscore::property($key);
}
コード例 #2
0
ファイル: Underscore.php プロジェクト: brombal/underscore.php
 /**
  * @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();
 }