示例#1
0
 /**
  * @testdox A color hex hash can be set and received in the correct and valid rgb format
  *
  * @covers Mautic\CoreBundle\Helper\EncryptionHelper::toRgb
  */
 public function testThatColorHexAreConvertedToRgbCorrectly()
 {
     $colors = ['#ccc' => 'rgb(204,204,204)', '#fff' => 'rgb(255,255,255)', '#000' => 'rgb(0,0,0)', '#333333' => 'rgb(51,51,51)', '#369' => 'rgb(51,102,153)', '#f8Ac30' => 'rgb(248,172,48)'];
     foreach ($colors as $hex => $rgb) {
         $helper = new ColorHelper($hex);
         $this->assertEquals($rgb, $helper->toRgb());
     }
 }