SelectQueryResultTest.php in Salesforce Suite 5.0.x
File
tests/src/Unit/SelectQueryResultTest.php
View source
<?php
namespace Drupal\Tests\salesforce\Unit;
use Drupal\Tests\UnitTestCase;
use Drupal\salesforce\SFID;
use Drupal\salesforce\SelectQueryResult;
class SelectQueryResultTest extends UnitTestCase {
protected static $modules = [
'salesforce',
];
protected function setUp() : void {
parent::setUp();
$result = [
'totalSize' => 2,
'done' => TRUE,
'records' => [
[
'Id' => '1234567890abcde',
'attributes' => [
'type' => 'dummy',
],
'name' => 'Example',
],
[
'Id' => '1234567890abcdf',
'attributes' => [
'type' => 'dummy',
],
'name' => 'Example2',
],
],
];
$this->sqr = new SelectQueryResult($result);
}
public function testGoodId() {
$this
->assertTrue($this->sqr instanceof SelectQueryResult);
}
public function testNoId() {
$sfid = new SFID('1234567890abcdg');
$this
->assertFalse($this->sqr
->record($sfid));
}
}