for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SugarAPI\SDK\Tests\Clients;
use SugarAPI\SDK\SugarAPI;
/**
* Class SugarAPITest
* @package SugarAPI\SDK\Tests\Clients
* @coversDefaultClass SugarAPI\SDK\SugarAPI
* @group clients
*/
class SugarAPITest extends \PHPUnit_Framework_TestCase {
public static function setUpBeforeClass()
{
}
public static function tearDownAfterClass()
protected $SugarAPI;
protected $credentials = array(
'username' => 'admin',
'password' => 'asdf',
'client_id' => 'sugar',
'client_secret' => '',
'platform' => 'api'
);
public function setUp()
$this->SugarAPI = new SugarAPI();
parent::setUp();
public function tearDown()
unset($this->SugarAPI);
parent::tearDown();
* @test
* @covers ::setCredentials
* @group sugarapi
public function testSetCredentials()
$this->SugarAPI->setCredentials(array('username' => 'admin'));
$this->assertEquals(array(
'password' => '',
),$this->SugarAPI->getCredentials());
$this->SugarAPI->setCredentials(array('password' => 'asdf'));
$this->assertEquals($this->credentials,$this->SugarAPI->getCredentials());
$this->SugarAPI->setCredentials(array());
$this->SugarAPI->setCredentials($this->credentials);
$this->SugarAPI->setCredentials(array('foo' => 'bar' ));