public function test_compareElements()
 {
     $tests = array('string = string' => array('a', 'a', 0), 'string > string' => array('b', 'a', 1), 'string < string' => array('a', 'b', -1), 'string vs array' => array('a', array('a'), -1), 'array vs string' => array(array('a'), 'a', 1), 'array = array' => array(array('a'), array('a'), 0), 'array > array' => array(array('b'), array('a'), 1), 'array < array' => array(array('a'), array('b'), -1));
     foreach ($tests as $description => $test) {
         list($a, $b, $expected) = $test;
         $result = Piwik_Config::compareElements($a, $b);
         $this->assertEqual($result, $expected, $description);
     }
 }
Exemple #2
0
 /**
  * @group Core
  * @group Config
  * @dataProvider getCompareElementsData
  */
 public function testCompareElements($description, $test)
 {
     list($a, $b, $expected) = $test;
     $result = Piwik_Config::compareElements($a, $b);
     $this->assertEquals($expected, $result, $description);
 }