/**
  * @covers OperationalCountryDao::getLocationsMappedToOperationalCountry
  */
 public function testGetLocationsMappedToOperationalCountry_Successful()
 {
     $sampleData = sfYaml::load($this->fixture);
     $sampleData = $sampleData['Location'];
     $result = $this->dao->getLocationsMappedToOperationalCountry('LK');
     $this->assertTrue($result instanceof Doctrine_Collection);
     $this->assertEquals(2, $result->count());
     $sampleDataIndices = array(0, 1);
     foreach ($result as $i => $location) {
         $index = $sampleDataIndices[$i];
         $this->assertTrue($location instanceof Location);
         $this->assertEquals($sampleData[$index]['id'], $location->getId());
         $this->assertEquals($sampleData[$index]['name'], $location->getName());
     }
     $result = $this->dao->getLocationsMappedToOperationalCountry('US');
     $this->assertTrue($result instanceof Doctrine_Collection);
     $this->assertEquals(1, $result->count());
     $sampleDataIndices = array(2);
     foreach ($result as $i => $location) {
         $index = $sampleDataIndices[$i];
         $this->assertTrue($location instanceof Location);
         $this->assertEquals($sampleData[$index]['id'], $location->getId());
         $this->assertEquals($sampleData[$index]['name'], $location->getName());
     }
 }
 public function testGetOperationalCountriesForLocations()
 {
     $sampleData = sfYaml::load($this->fixture);
     $sampleOperationalCountries = $sampleData['OperationalCountry'];
     // Empty locations
     $locationIds = array();
     $result = $this->dao->getOperationalCountriesForLocations($locationIds);
     // unavalable location
     $locationIds = array(11);
     $result = $this->dao->getOperationalCountriesForLocations($locationIds);
     $this->assertEquals(0, count($result));
     // location without operational country
     $locationIds = array(4);
     $result = $this->dao->getOperationalCountriesForLocations($locationIds);
     $this->assertEquals(0, count($result));
     $expected = array($sampleOperationalCountries[0]);
     $locationIds = array(1);
     $result = $this->dao->getOperationalCountriesForLocations($locationIds);
     $this->compareOperationalCountries($expected, $result);
     $expected = array($sampleOperationalCountries[0], $sampleOperationalCountries[1]);
     $locationIds = array(1, 2, 3, 4);
     $result = $this->dao->getOperationalCountriesForLocations($locationIds);
     $this->compareOperationalCountries($expected, $result);
 }