* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Console\Tests\Formatter; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Formatter\OutputFormatterStyleStack; use Symfony\Component\Console\Formatter\OutputFormatterStyle; class OutputFormatterStyleStackTest extends TestCase { public function testPush() { $stack = new OutputFormatterStyleStack(); $stack->push($s1 = new OutputFormatterStyle('white', 'black')); $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue')); $this->assertEquals($s2, $stack->getCurrent()); $stack->push($s3 = new OutputFormatterStyle('green', 'red')); $this->assertEquals($s3, $stack->getCurrent()); } public function testPop() { $stack = new OutputFormatterStyleStack(); $stack->push($s1 = new OutputFormatterStyle('white', 'black')); $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue')); $this->assertEquals($s2, $stack->pop()); $this->assertEquals($s1, $stack->pop()); } public function testPopEmpty() { $stack = new OutputFormatterStyleStack(); $style = new OutputFormatterStyle(); $this->assertEquals($style, $stack->pop()); } public function testPopNotLast() { $stack = new OutputFormatterStyleStack(); $stack->push($s1 = new OutputFormatterStyle('white', 'black')); $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue')); $stack->push($s3 = new OutputFormatterStyle('green', 'red')); $this->assertEquals($s2, $stack->pop($s2)); $this->assertEquals($s1, $stack->pop()); } /** * @expectedException \InvalidArgumentException */ public function testInvalidPop() { $stack = new OutputFormatterStyleStack(); $stack->push(new OutputFormatterStyle('white', 'black')); $stack->pop(new OutputFormatterStyle('yellow', 'blue')); } } __halt_compiler();----SIGNATURE:----momG34ZEFw2djy4TqdSBtrW2uA5NMvOHVHzNI5itahNlLZkaDqJ+q1BMhiqP08AKkYlzr8JInoBCb7cCYcp0MQOPFTJCKd/TEMfl/aCBxT6r+ZrCwTv+vnZ0CtYE89LqS1pmd4KyBX0N7FfKIT0veluFjUubHXe4kQAZO/Rs8UCgdZg5WRHiC0v0vz9huqjd6AygisERVO//ts+gtZxJ7ZJlAtT3KnG70hbJd7CwaLMhGTubdnutZ6RFLvybVUTei24AwZ1jhnFuSwab2F2DOyjDMmhxdpS9T5UeiaMgeDe7mmkCyM0zxKMT9/Jv5ueUmVSCkxDAyyKkImUvcga1uQuzCEuGx+NvcMKmRjRrcHFQWPTBrOFAZKDdjCcn7GbhYFbIVA0KFhsDtTOOm7m7Kzm53eS+mhCbFY+a4GdaS+DqDBtil/Sh/52DSGr0pPWW0qNCHyfzJi+rY1Mzcg9tm/1AVoWIrC57s1XyuPh1jEElfMz/efKnKarUcxY+Y9hafWZf9F5x5oq27cZLlMRpcaln/lmE7luFxiqcYuQBsZW2EV7JLmBSoWBYfUQx9KkQ206ya+acxS/PfQRDF6MBn1FCghwkJ4KqY5wuIK1mEYIJgqZVs//5QXNkxfFraZAYY2Xs5tKUFpSvTf4/u1l2lrt3sajYL70fyYkDBDvCFfw=----ATTACHMENT:----MTk4Mjc0NjQzOTcxOTEzOSA5NjIzODQ5NTAyNjEzMTYxIDE5OTU0MzIzOTQ1NjYzMTQ=