Example #1
0
 public function testReverse()
 {
     $list = array(MW_Convert_Factory::createConverter('DateTime/EnglishISO'), MW_Convert_Factory::createConverter('Text/LatinUTF8'));
     $object = new MW_Convert_Compose($list);
     $this->assertInstanceOf('MW_Convert_Interface', $object);
     $this->assertEquals('01/02/2000 00:00:00 AM', $object->reverse('2000-01-02 00:00:00'));
 }
Example #2
0
 /**
  * Returns the list of converter objects based on the given converter map
  *
  * @param array $convmap List of converter names for the values at the position in the CSV file
  * @return array Associative list of positions and converter objects
  */
 protected function _getConverterList(array $convmap)
 {
     $convlist = array();
     foreach ($convmap as $idx => $name) {
         $convlist[$idx] = MW_Convert_Factory::createConverter($name);
     }
     return $convlist;
 }
Example #3
0
 public function testCreateConverterInvalidInterface()
 {
     $this->setExpectedException('MW_Convert_Exception');
     MW_Convert_Factory::createConverter('Test/Test');
 }