Beispiel #1
0
 public function testConflicted()
 {
     $table1 = harness_Native::table($this->data1);
     $table2 = harness_Native::table($this->data2);
     $table3 = harness_Native::table($this->data3b);
     $table4 = harness_Native::table($this->data4b);
     $flags = new coopy_CompareFlags();
     $merger = new coopy_Merger($table1, $table2, $table3, $flags);
     $conflicts = $merger->apply();
     $this->assertEquals($conflicts, 1, _hx_anonymous(array("fileName" => "MergeTest.hx", "lineNumber" => 64, "className" => "harness.MergeTest", "methodName" => "testConflicted")));
     $this->assertEquals(coopy_SimpleTable::tableToString($table2), coopy_SimpleTable::tableToString($table4), _hx_anonymous(array("fileName" => "MergeTest.hx", "lineNumber" => 65, "className" => "harness.MergeTest", "methodName" => "testConflicted")));
 }
 public function toString()
 {
     return coopy_SimpleTable::tableToString($this);
 }
 static function tableIsSimilar($tab1, $tab2)
 {
     if ($tab1->get_height() === -1 || $tab2->get_height() === -1) {
         $txt1 = coopy_SimpleTable::tableToString($tab1);
         $txt2 = coopy_SimpleTable::tableToString($tab2);
         return $txt1 === $txt2;
     }
     if ($tab1->get_width() !== $tab2->get_width()) {
         return false;
     }
     if ($tab1->get_height() !== $tab2->get_height()) {
         return false;
     }
     $v = $tab1->getCellView();
     $_g1 = 0;
     $_g = $tab1->get_height();
     while ($_g1 < $_g) {
         $i = $_g1++;
         $_g3 = 0;
         $_g2 = $tab1->get_width();
         while ($_g3 < $_g2) {
             $j = $_g3++;
             if (!$v->equals($tab1->getCell($j, $i), $tab2->getCell($j, $i))) {
                 return false;
             }
             unset($j);
         }
         unset($_g3, $_g2);
         unset($i);
     }
     return true;
 }