salesforce-8.x-4.x-dev/tests/src/Unit/SFIDTest.php

tests/src/Unit/SFIDTest.php
<?php

namespace Drupal\Tests\salesforce\Unit;

use Drupal\salesforce\SFID;
use Drupal\Tests\UnitTestCase;

/**
 * Test Object instantiation.
 *
 * @group salesforce_pull
 */
class SFIDTest extends UnitTestCase {

  /**
   * Required modules.
   *
   * @var array
   */
  static protected $modules = ['salesforce'];

  /**
   * Test object instantiation with good ID.
   */
  public function testGoodId() {
    $sfid = new SFID('1234567890abcde');
    $this->assertTrue($sfid instanceof SFID);
  }

  /**
   * Test object instantiation with bad ID.
   */
  public function testBadId() {
    $this->expectException(\Exception::class);
    new SFID('1234567890');
  }

  /**
   * Test object instantiation with bad ID.
   */
  public function testConvertId() {
    $sfid = new SFID('1234567890adcde');
    $this->assertEquals('1234567890adcdeAAA', $sfid);
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc