- 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;
+ public function newChapter($input = ['name' => 'test chapter', 'description' => 'My new test chapter'], Book $book) {
+ return $this->app[EntityRepo::class]->createFromInput('chapter', $input, $book);