Example #1
0
 /**
  * Assert a key is a unique index.
  *
  * @param string $key
  * @param array $indexes
  * @return void
  */
 protected function assertUniqueIndex($key, $indexes)
 {
     $this->context->assertArrayHasKey($key, $indexes, "The {$this->name} column is not indexed.");
     $this->assertTrue($indexes[$key]->isUnique(), "The {$this->name} is not a unique index.");
 }
Example #2
0
 /**
  * Assert that the table exists in the database.
  *
  * @return $this
  */
 public function exists()
 {
     $this->context->assertTrue(Schema::hasTable($this->name), "The table {$this->name} does not exist.");
     return $this;
 }