You are here

function MerciTest::testMerciTooManyPlusConflictResources in MERCI (Manage Equipment Reservations, Checkout and Inventory) 8.2

File

src/Tests/MerciTest.php, line 274
Contains \Drupal\merci\Tests\MerciTest.

Class

MerciTest
Tests pager functionality.

Namespace

Drupal\merci\Tests

Code

function testMerciTooManyPlusConflictResources() {

  // Login the merci user.
  $this
    ->drupalLogin($this->merci_user);
  $node = $this
    ->merciCreateReservation("Sunday 3pm", "Sunday 4pm");
  $node
    ->save();

  // Should fail.
  $node = $this
    ->merciCreateReservation("Sunday 3pm", "Sunday 4pm");
  $violations = $node
    ->validate();
  $pattern = '@is already reserved by:@';
  $message = "There is a conflict";
  $this
    ->assert((bool) preg_match($pattern, $violations
    ->get(0)
    ->getMessage()
    ->render()), $message);
}