Ejemplo n.º 1
0
 public function test__construct()
 {
     $colorizer = new cli\colorizer();
     $this->assert->variable($colorizer->getForeground())->isNull()->variable($colorizer->getBackground())->isNull()->object($colorizer->getCli())->isEqualTo(new atoum\cli());
     $colorizer = new cli\colorizer($foreground = uniqid());
     $this->assert->string($colorizer->getForeground())->isEqualTo($foreground)->variable($colorizer->getBackground())->isNull()->object($colorizer->getCli())->isEqualTo(new atoum\cli());
     $colorizer = new cli\colorizer($foreground = rand(1, PHP_INT_MAX));
     $this->assert->string($colorizer->getForeground())->isEqualTo($foreground)->variable($colorizer->getBackground())->isNull()->object($colorizer->getCli())->isEqualTo(new atoum\cli());
     $colorizer = new cli\colorizer($foreground = uniqid(), $background = uniqid());
     $this->assert->string($colorizer->getForeground())->isEqualTo($foreground)->string($colorizer->getBackground())->isEqualTo($background)->object($colorizer->getCli())->isEqualTo(new atoum\cli());
     $colorizer = new cli\colorizer($foreground = uniqid(), $background = rand(1, PHP_INT_MAX));
     $this->assert->string($colorizer->getForeground())->isEqualTo($foreground)->string($colorizer->getBackground())->isEqualTo($background)->object($colorizer->getCli())->isEqualTo(new atoum\cli());
     $colorizer = new cli\colorizer($foreground = uniqid(), $background = rand(1, PHP_INT_MAX), $cli = new atoum\cli());
     $this->assert->string($colorizer->getForeground())->isEqualTo($foreground)->string($colorizer->getBackground())->isEqualTo($background)->object($colorizer->getCli())->isIdenticalTo($cli);
 }
Ejemplo n.º 2
0
 public function testSetForeground()
 {
     $this->if($colorizer = new cli\colorizer(uniqid()))->then->object($colorizer->setForeground($foreground = uniqid()))->isIdenticalTo($colorizer)->string($colorizer->getForeground())->isEqualTo($foreground)->object($colorizer->setForeground($foreground = rand(1, PHP_INT_MAX)))->isIdenticalTo($colorizer)->string($colorizer->getForeground())->isEqualTo($foreground);
 }