public function SmsFrameworkMessageResultTestTrait::testCreditsBalance in SMS Framework 8
Same name and namespace in other branches
- 2.x tests/src/Functional/SmsFrameworkMessageResultTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkMessageResultTestTrait::testCreditsBalance()
- 2.1.x tests/src/Functional/SmsFrameworkMessageResultTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkMessageResultTestTrait::testCreditsBalance()
Tests credits balance.
@covers ::getCreditsBalance @covers ::setCreditsBalance
File
- tests/
src/ Functional/ SmsFrameworkMessageResultTestTrait.php, line 119
Class
- SmsFrameworkMessageResultTestTrait
- Provides common tests for SmsMessageResult object and entity classes.
Namespace
Drupal\Tests\sms\FunctionalCode
public function testCreditsBalance() {
$result = $this
->createMessageResult();
$this
->assertNull($result
->getCreditsBalance(), 'No credit balance set');
$balance = 13.37;
$return = $result
->setCreditsBalance($balance);
$this
->assertTrue($return instanceof SmsMessageResultInterface);
$this
->assertEquals($balance, $result
->getCreditsBalance());
}