ColorThief\Test\ColorThiefTest::testVboxFromPixels PHP Method

testVboxFromPixels() public method

public testVboxFromPixels ( )
    public function testVboxFromPixels()
    {
        $method = new \ReflectionMethod('\\ColorThief\\ColorThief', 'vboxFromHistogram');
        $method->setAccessible(true);
        // [[229, 210, 51], [133, 24, 135], [216, 235, 108], [132, 25, 134], [223, 46, 29],
        // [135, 28, 132], [233, 133, 213], [225, 212, 48]]
        //$pixels = array(15061555, 8722567, 14216044, 8657286, 14626333, 8854660, 15304149, 14799920);
        $histo = array(29510 => 2, 16496 => 3, 28589 => 1, 27811 => 1, 30234 => 1);
        $result = $method->invoke(null, $histo);
        $this->assertInstanceOf('\\ColorThief\\VBox', $result);
        $this->assertSame($histo, $result->histo);
        $this->assertSame(16, $result->r1);
        $this->assertSame(29, $result->r2);
        $this->assertSame(3, $result->g1);
        $this->assertSame(29, $result->g2);
        $this->assertSame(3, $result->b1);
        $this->assertSame(26, $result->b2);
    }