You are here

public function SmsFrameworkMessageResultTestTrait::testCreditsUsed in SMS Framework 8

Same name and namespace in other branches
  1. 2.x tests/src/Functional/SmsFrameworkMessageResultTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkMessageResultTestTrait::testCreditsUsed()
  2. 2.1.x tests/src/Functional/SmsFrameworkMessageResultTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkMessageResultTestTrait::testCreditsUsed()

Tests credits used.

@covers ::getCreditsUsed @covers ::setCreditsUsed

File

tests/src/Functional/SmsFrameworkMessageResultTestTrait.php, line 148

Class

SmsFrameworkMessageResultTestTrait
Provides common tests for SmsMessageResult object and entity classes.

Namespace

Drupal\Tests\sms\Functional

Code

public function testCreditsUsed() {
  $result = $this
    ->createMessageResult();
  $this
    ->assertNull($result
    ->getCreditsUsed(), 'No credits used set');
  $used = 13.37;
  $return = $result
    ->setCreditsUsed($used);
  $this
    ->assertTrue($return instanceof SmsMessageResultInterface);
  $this
    ->assertEquals($used, $result
    ->getCreditsUsed());
}