Ejemplo n.º 1
0
 public function testRemoveEmptyOperations()
 {
     $diff = new Diff(array());
     $diff['foo'] = new DiffOpAdd(1);
     $diff['bar'] = new Diff(array(new DiffOpAdd(1)), true);
     $diff['baz'] = new Diff(array(new DiffOpAdd(1)), false);
     $diff['bah'] = new Diff(array(), false);
     $diff['spam'] = new Diff(array(), true);
     $diff->removeEmptyOperations();
     $this->assertTrue($diff->offsetExists('foo'));
     $this->assertTrue($diff->offsetExists('bar'));
     $this->assertTrue($diff->offsetExists('baz'));
     $this->assertFalse($diff->offsetExists('bah'));
     $this->assertFalse($diff->offsetExists('spam'));
 }