public function testEncode() { $num_pixels = self::TEST_WIDTH * self::TEST_HEIGHT; $frame = array_fill(0, $num_pixels, 0); $set_pixels = [2, 3, 9, 10]; $expected = ['frame' => []]; foreach ($set_pixels as $sp) { $frame[$sp] = 1; $expected['frame'][(string) $sp] = JsonFrameEncoder::COLOR_FG; } $this->assertEquals(json_encode($expected), $this->encoder->encodeFrame($frame)); }
public function testEncodeFrameInfo() { $this->assertEquals('', $this->encoder->encodeFrameInfo($this->frameBuffer)); }