示例#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);
 }
示例#2
0
 public function testSetBackground()
 {
     $this->if($colorizer = new cli\colorizer(uniqid()))->then->object($colorizer->setBackground($background = uniqid()))->isIdenticalTo($colorizer)->string($colorizer->getBackground())->isEqualTo($background)->object($colorizer->setBackground($background = rand(1, PHP_INT_MAX)))->isIdenticalTo($colorizer)->string($colorizer->getBackground())->isEqualTo($background);
 }