Skip to content

Commit

Permalink
Added finalize test.
Browse files Browse the repository at this point in the history
  • Loading branch information
mishavantol committed Feb 20, 2015
1 parent c9e5bac commit 3fee31d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"ext-curl": "*",
"rhumsaa/array_column": "~1.1"
},
"require-dev": {
"phpunit/phpunit": "4.6.*@dev"
},
"autoload": {
"psr-0": {
"Communibase": "src/"
Expand Down
18 changes: 18 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="Test Suite">
<directory>./test/</directory>
</testsuite>
</testsuites>
</phpunit>
26 changes: 26 additions & 0 deletions test/Communibase/FinalizeTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
namespace Communibase;

/**
* @package Communibase
* @author Kingsquare (source@kingsquare.nl)
* @copyright Copyright (c) Kingsquare BV (http://www.kingsquare.nl)
*/
class FinalizeTest extends \PHPUnit_Framework_TestCase {

/**
* @TODO Test schould also check the reversed.
* @expectedException Exception
* @expectedExceptionMessage Cannot call finalize on Person
*/
public function testFinalizeCallIsPossibleForInvoiceOnly() {
$stub = $this->getMockBuilder('Communibase\Connector')
->setMethods(null)
->disableOriginalConstructor()
->getMock();

// must throw exception
$stub->finalize('Person', 'id');
}

}

0 comments on commit 3fee31d

Please sign in to comment.