Esempio n. 1
0
 public function testIsWithLightImageComplex()
 {
     $image = new Image(array('classes' => array('color' => 'imageColorTest\\stubs\\util\\ColorStub')));
     $image->primaryColors = array('red' => 20, 'yellow' => 30, 'blue' => 30);
     ColorStub::$data['colors'] = function () {
         return array('red' => (object) array('lightness' => 80), 'yellow' => (object) array('lightness' => 20), 'blue' => (object) array('lightness' => 0));
     };
     $this->assertTrue($image->is('black'));
     $this->assertTrue($image->is('dark'));
     $this->assertFalse($image->is('white'));
     $this->assertFalse($image->is('light'));
 }