/** * Sets up test rows. */ protected function setUpTestRows() { $fileCollection = $this->getConnection()->getFileCollection(CustomerFile::collectionName()); $customers = []; $files = []; for ($i = 1; $i <= 5; $i++) { $file = ['tag' => 'tag' . $i, 'status' => $i]; $content = 'content' . $i; $file['_id'] = $fileCollection->insertFileContent($content, $file); $file['content'] = $content; $files[] = $file; $customers[] = ['name' => 'name' . $i, 'email' => 'email' . $i, 'address' => 'address' . $i, 'status' => $i, 'file_id' => $file['_id']]; } $customerCollection = $this->getConnection()->getCollection(Customer::collectionName()); $customers = $customerCollection->batchInsert($customers); }
protected function tearDown() { $this->dropCollection(Customer::collectionName()); $this->dropCollection(CustomerOrder::collectionName()); parent::tearDown(); }