Пример #1
0
 public function testGetType()
 {
     $blob = new Object(self::$repository, 'd77231cee7bf500a9aa7ada4ca76dfd7dfef1d49');
     $tree = new Object(self::$repository, '6c0fe566aeeba93df77b2e3d50c84fc51d6a14cf');
     $commit = new Object(self::$repository, '74770c3b7ca5b6ab5400e291065ce48bb3e31785');
     $this->assertEquals($blob->getType(), 'blob');
     $this->assertEquals($tree->getType(), 'tree');
     $this->assertEquals($commit->getType(), 'commit');
 }
Пример #2
0
 /**
  * Compare 2 object and determines if they are equals.
  *
  * @param Object $object
  * @return bool Whenever the given object is the same as the current object.
  */
 public function is($object)
 {
     return $object instanceof Object && $this->getHash() === $object->getHash();
 }