예제 #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 testSetCli()
 {
     $this->if($colorizer = new cli\colorizer(uniqid()))->then->object($colorizer->setCli($cli = new atoum\cli()))->isIdenticalTo($colorizer)->object($colorizer->getCli())->isIdenticalTo($cli)->object($colorizer->setCli())->isIdenticalTo($colorizer)->object($colorizer->getCli())->isNotIdenticalTo($cli)->isEqualTo(new atoum\cli());
 }