* * 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:----IX6GMR9JK7UYP53Vg5Vb2+WG7SVYebACLuV1yKL17pWmYYCnRrARAOWgodrIHbG58QMZwHb+3dnqz2H9aBw+prIOtIySF6QF8h03fgZnE2O8aoo40pinoFXNzXUYfwiaF6W+Rh4XfEhLivLQOFhFyQjq7X9hs3NtCQcbPulZMv1J43V6HVaLuqbRaQCvnHGFkUseSkjd0YJxzXAfA28vuXTbfjH1i37HCi0uKFIw29ZZBMCfYPD7tv+rsL86waRqXKRNCx/Jf/fA2qjq4jg6Xu+4tPw/NkffIQ2QIGSFUbZYcDywXqXH+KKjfM62sYtfmjnMc8kqv5fx7xg+2pMaxYs3VW4GcfpafT6tKeYSiF/7RH8eO4hjh+q2VdzhXM/bGqaiIPRlacHXv+Jv8CfJEh/IQ1aZg1olrUradTlq6TDUNcz3gFcjeLKn+eWQCPLyhj4cg2MvDynADveOPebrR7X8eJoVorhfg+a4G6aKYuqyFuepbhKh2a1D0ij/lxMDsZe3b50RDmnzsMqA/jLP9Ed9ZhaI/eIri2A5ksIFBUYrWUreB2zt0bb1Im6YQDXfu4fXs91uEcT+J4D/AOb5OpXYNpliXVYqU+a4F4kAyY960LNWHXPGOGvzZbOa+hdtG8OVHi+KYEI7vi98SRON1PpcA3g98+eOI9Nw6HZA7aU=----ATTACHMENT:----NTkwMTE2MjcwOTA4NTI4MCA4MjgzMTczODEwNzM5NzQ5IDIzNzExODIxNDk4ODM5ODg=