Skip to content

Commit

Permalink
[transaction] add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dcramer committed Sep 29, 2016
1 parent b5f336a commit 6c7dd66
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/Raven/Tests/TransactionStackTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

/*
* This file is part of Raven.
*
* (c) Sentry Team
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/


class Raven_Tests_TransactionStackTest extends PHPUnit_Framework_TestCase
{
public function testSimple()
{
$stack = new Raven_TransactionStack();
$stack->push('hello');
$foo = $stack->push('foo');
$stack->push('bar');
$stack->push('world');
$this->assertEquals($stack->peek(), 'world');
$this->assertEquals($stack->pop(), 'world');
$this->assertEquals($stack->pop('foo'), 'foo');
$this->assertEquals($stack->peek(), 'hello');
$this->assertEquals($stack->pop(), 'hello');
$this->assertEquals($stack->peek(), null);
}
}

0 comments on commit 6c7dd66

Please sign in to comment.