* * 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:----Ni65aOGwtTsOdePUOmpik4xw5kmNNhj4pREKXvsgvWC2alHHatiUEHJbbOmE3P8J26kzT0wzqpaGHHthe1aifsSplFEW6Gv8E9H0TmxD5JI0dcWnYWv6lz+EwaT/r2D0VedMk/1z9UxDRrRKgWvIX//z+4mTwqWuaWuP1HOPD04Qu0B5BPPcyphUhQR8ZB5QV6di7BurUSr0MnuppzjWrFji5jsdBeVkgSh0LEwT5Cb/ZJxk8L9VneTQkc3nxf3lNmG1xVPKPp/MWzh+znga9XPRInJ9nNfSu2OQRj2A9ocZl3e1WnEZQN+wuuiPX4iUY3LHWj/UCl71P7kYVGaoGb+s8lfzUjV+VJfG5KoTyGL+EVgJgWqAjGUWI8yFrMJpeihZ3sabSD/MxwZPC4dxx4uTNTEKF8CdWb5MlbgU+We2Id58lWVQmNcXTXmPD/LKRc4Hjr7N82h7hknsQ+Nq5gr5XOvNyLeP9wI2TfTyWdMitb/0A7R4wsqoSCjFryYqhNFEbV+q65AaPb4HENwyVhKClGCCQWvuXPWTCTLPiI5gU3J3KyTBmUjTIeoRxNVOfdaJV3iTO5i/WM8eankdTKT5J7H8XRQMePsOirmSfm5wgHp6l0B+1A33joTvgi3TM4qWYTrN75YbPAuAMozOB2JxhPkWPdNeGQaBtN8675U=----ATTACHMENT:----MjA4MTY2MDE2NzM1NTQ4NSA2NTg4Njc2MjEwNDA5MzcyIDI1Njg4NTU0MDczMTk4NDg=