-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mettre le buyer à null lors d'une transaction CB
Si l'utilisateur essaie de payer par compte payutc, que ça échoue, puis paie par CB, on veut effacer le buyerId pour pouvoir distinguer le type de transaction.
- Loading branch information
Showing
3 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,5 +135,23 @@ public function testCreateEmail(){ | |
$transaction2 = Transaction::getById($transaction->getId()); | ||
$this->assertEquals("[email protected]", $transaction2->getEmail()); | ||
} | ||
|
||
/** | ||
* @requires PHP 5.4 | ||
*/ | ||
public function testSetToNull(){ | ||
$items = array( | ||
array(4, 1), | ||
array(4, 3) | ||
); | ||
$matthieu = new User("mguffroy"); | ||
$transaction = Transaction::create($matthieu, $matthieu, 51, 1, $items, null, null); | ||
|
||
$this->assertEquals(600, $transaction->getMontantTotal()); | ||
|
||
$transaction->setBuyer(null); | ||
|
||
$this->assertEquals(null, $transaction->getBuyerId()); | ||
} | ||
} | ||
|