You are here

public function InvoiceConfirmationTest::testInvoiceConfirmationDisabled in Commerce Invoice 8.2

Tests default disabled invoice confirmation.

File

tests/src/Kernel/InvoiceConfirmationTest.php, line 156

Class

InvoiceConfirmationTest
Tests the sending of multilingual invoice confirmation emails.

Namespace

Drupal\Tests\commerce_invoice\Kernel

Code

public function testInvoiceConfirmationDisabled() {
  $invoice = Invoice::create([
    'type' => 'default',
    'mail' => $this->user
      ->getEmail(),
    'invoice_number' => '10',
    'orders' => [
      $this->order,
    ],
    'store_id' => $this->store
      ->id(),
    'billing_profile' => $this->profile,
    'uid' => $this->user
      ->id(),
  ]);
  $invoice
    ->getState()
    ->applyTransitionById('confirm');
  $invoice
    ->save();

  // Confirm that pdf file has not been created for the invoice.
  $this
    ->assertEmpty($invoice
    ->getFile());
  $this
    ->assertCount(0, $this
    ->getMails());
}