Skip to content

Commit

Permalink
Add rolled_back getter/setter to Transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
stratedge committed Jul 31, 2017
1 parent 802d1df commit e8840b0
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,31 @@ public function setCommitted($committed)
}


//**************************************************************************
// ROLLED_BACK
//**************************************************************************

/**
* Returns the value of the rolled_back property.
*
* @return boolean
*/
public function getRolledBack()
{
return $this->rolled_back;
}

/**
* Sets the value of the rolled_back property.
*
* @param boolean $rolled_back
*/
public function setRolledBack($rolled_back)
{
$this->rolled_back = (bool) $rolled_back;
}



//**************************************************************************
// STATEMENTS
Expand Down
19 changes: 19 additions & 0 deletions tests/Transaction/GetRolledBackTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Tests\Transaction;

use Stratedge\Wye\Wye;

class GetRolledBackTest extends \Tests\TestCase
{
public function testReturnsPropertyValue()
{
$transaction = Wye::makeTransaction();

$this->assertFalse($transaction->getRolledBack());

$transaction->setRolledBack(true);

$this->assertTrue($transaction->getRolledBack());
}
}
23 changes: 23 additions & 0 deletions tests/Transaction/SetRolledBackTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Tests\Transaction;

use Stratedge\Wye\Wye;

class SetRolledBackTest extends \Tests\TestCase
{
public function testSetsPropertyValue()
{
$transaction = Wye::makeTransaction();

$this->assertFalse($transaction->getRolledBack());

$transaction->setRolledBack(true);

$this->assertTrue($transaction->getRolledBack());

$transaction->setRolledBack(false);

$this->assertFalse($transaction->getRolledBack());
}
}

0 comments on commit e8840b0

Please sign in to comment.