- protected function getNewBlankUser($attributes = [])
- {
- $user = factory(\BookStack\User::class)->create($attributes);
- return $user;
- }
-
- /**
- * Assert that a given string is seen inside an element.
- *
- * @param bool|string|null $element
- * @param integer $position
- * @param string $text
- * @param bool $negate
- * @return $this
- */
- protected function seeInNthElement($element, $position, $text, $negate = false)
- {
- $method = $negate ? 'assertNotRegExp' : 'assertRegExp';
-
- $rawPattern = preg_quote($text, '/');
-
- $escapedPattern = preg_quote(e($text), '/');
-
- $content = $this->crawler->filter($element)->eq($position)->html();
-
- $pattern = $rawPattern == $escapedPattern
- ? $rawPattern : "({$rawPattern}|{$escapedPattern})";
-
- $this->$method("/$pattern/i", $content);
-
- return $this;
- }
-
- /**
- * Assert that the current page matches a given URI.
- *
- * @param string $uri
- * @return $this
- */
- protected function seePageUrlIs($uri)
- {
- $this->assertEquals(
- $uri, $this->currentUri, "Did not land on expected page [{$uri}].\n"
- );
-
- return $this;
+ public function getEditor() {
+ if($this->editor === null) {
+ $editorRole = Role::getRole('editor');
+ $this->editor = $editorRole->users->first();
+ }
+ return $this->editor;