for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Communibase;
/**
* @package Communibase
* @author Kingsquare ([email protected])
* @copyright Copyright (c) Kingsquare BV (http://www.kingsquare.nl)
*/
class FinalizeTest extends \PHPUnit_Framework_TestCase
{
* @return array
public function provider()
return [
['Person', true],
['Invoice', false],
];
}
* @dataProvider provider
*
* @param string $entityType
* @param string $expectException
* @throws Exception
public function testFinalizeCallIsPossibleForInvoiceOnly($entityType, $expectException)
/** @var Connector $stub */
$stub = $this->getMockBuilder(Connector::class)
->setMethods(['doPost'])
->disableOriginalConstructor()
->getMock();
if ($expectException) {
$this->setExpectedException(Exception::class, 'Cannot call finalize on Person');
$stub->finalize($entityType, 'id');