<commit_before><?php
    namespace Chameleon\Colors;

    use PHPUnit\Framework\TestCase;

    use Chameleon\Colors\RGBAColor;
    use Chameleon\Exceptions\ValueOutOfBoundsException;

    final class RGBAColorTest extends TestCase {

        private $color;

        /**
         * @before
         */
        public function setUp() {
            $this -> color = new RGBAColor(255, 127, 63, 16);
        }

        /**
         * @covers \Chameleon\Colors\RGBAColor::__construct
         */
        public function testConstruct() {
            $this -> assertObjectHasAttribute("alpha", $this -> color);
        }

        /**
         * @covers \Chameleon\Colors\RGBAColor::__toString
         */
        public function testToString() {
            $this -> assertEquals("rgba(255, 127, 63, 16)", $this -> color -> __toString());
        }

        /**
         * @covers \Chameleon\Colors\RGBAColor::getAlpha
         */
        public function testGetAlpha() {
            $this -> assertEquals(16, $this -> color -> getAlpha());
        }

        /**
         * @covers \Chameleon\Colors\RGBAColor::setAlpha
         */
        public function testSetAlpha() {
            $this -> color -> setAlpha(0);
            $this -> assertEquals(0, $this -> color -> getAlpha());
        }

        /**
         * @covers \Chameleon\Colors\RGBAColor::setAlpha
         */
        public function testSetAlphaTooHigh() {
            $this -> expectException(ValueOutOfBoundsException::class);
            $this -> color -> setAlpha(128);
        }

        /**
         * @covers \Chameleon\Colors\RGBAColor::setAlpha
         */
        public function testSetAlphaTooLow() {
            $this -> expectException(ValueOutOfBoundsException::class);
            $this -> color -> setAlpha(-1);
        }

        /**
         * @covers \Chameleon\Colors\RGBAColor::getRGBA
         */
        public function testGetRGBA() {
            $expected = new RGBAColor(255, 127, 63, 16);
            $actual = $this -> color -> getRGBA();

            $this -> assertEquals($expected, $actual);
        }

        /**
         * @covers \Chameleon\Colors\RGBAColor::getRGBA
         */
        public function testFromRGBA() {
            $expected = new RGBAColor(255, 127, 63, 16);
            $actual = RGBAColor::fromRGBA(new RGBAColor(255, 127, 63, 16));

            $this -> assertEquals($expected, $actual);
        }
    }
?><commit_msg>fix covers annotation<commit_after><?php
    namespace Chameleon\Colors;

    use PHPUnit\Framework\TestCase;

    use Chameleon\Colors\RGBAColor;
    use Chameleon\Exceptions\ValueOutOfBoundsException;

    final class RGBAColorTest extends TestCase {

        private $color;

        /**
         * @before
         */
        public function setUp() {
            $this -> color = new RGBAColor(255, 127, 63, 16);
        }

        /**
         * @covers \Chameleon\Colors\RGBAColor::__construct
         */
        public function testConstruct() {
            $this -> assertObjectHasAttribute("alpha", $this -> color);
        }

        /**
         * @covers \Chameleon\Colors\RGBAColor::__toString
         */
        public function testToString() {
            $this -> assertEquals("rgba(255, 127, 63, 16)", $this -> color -> __toString());
        }

        /**
         * @covers \Chameleon\Colors\RGBAColor::getAlpha
         */
        public function testGetAlpha() {
            $this -> assertEquals(16, $this -> color -> getAlpha());
        }

        /**
         * @covers \Chameleon\Colors\RGBAColor::setAlpha
         */
        public function testSetAlpha() {
            $this -> color -> setAlpha(0);
            $this -> assertEquals(0, $this -> color -> getAlpha());
        }

        /**
         * @covers \Chameleon\Colors\RGBAColor::setAlpha
         */
        public function testSetAlphaTooHigh() {
            $this -> expectException(ValueOutOfBoundsException::class);
            $this -> color -> setAlpha(128);
        }

        /**
         * @covers \Chameleon\Colors\RGBAColor::setAlpha
         */
        public function testSetAlphaTooLow() {
            $this -> expectException(ValueOutOfBoundsException::class);
            $this -> color -> setAlpha(-1);
        }

        /**
         * @covers \Chameleon\Colors\RGBAColor::getRGBA
         */
        public function testGetRGBA() {
            $expected = new RGBAColor(255, 127, 63, 16);
            $actual = $this -> color -> getRGBA();

            $this -> assertEquals($expected, $actual);
        }

        /**
         * @covers \Chameleon\Colors\RGBAColor::fromRGBA
         */
        public function testFromRGBA() {
            $expected = new RGBAColor(255, 127, 63, 16);
            $actual = RGBAColor::fromRGBA(new RGBAColor(255, 127, 63, 16));

            $this -> assertEquals($expected, $actual);
        }
    }
?>
{'fraction_non_alphanumeric': 0.13464293022304072, 'fraction_numerical': 0.023736443625946388, 'mean_word_length': 1.720089037284363, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4096678', 'n_tokens_mistral': 1502, 'n_tokens_neox': 1384, 'n_words': 262}