]> BookStack Code Mirror - bookstack/blobdiff - tests/Api/ChaptersApiTest.php
Removed redundant null check
[bookstack] / tests / Api / ChaptersApiTest.php
index a99a85af8167b9009e01718ea086b5b92408102d..0629f3aedae61fadd338fcc9dc20cfefc959da2d 100644 (file)
@@ -45,37 +45,7 @@ class ChaptersApiTest extends TestCase
                     'value' => 'tagvalue',
                 ],
             ],
-        ];
-
-        $resp = $this->postJson($this->baseEndpoint, $details);
-        $resp->assertStatus(200);
-        $newItem = Chapter::query()->orderByDesc('id')->where('name', '=', $details['name'])->first();
-        $resp->assertJson(array_merge($details, ['id' => $newItem->id, 'slug' => $newItem->slug]));
-        $this->assertDatabaseHas('tags', [
-            'entity_id'   => $newItem->id,
-            'entity_type' => $newItem->getMorphClass(),
-            'name'        => 'tagname',
-            'value'       => 'tagvalue',
-        ]);
-        $resp->assertJsonMissing(['pages' => []]);
-        $this->assertActivityExists('chapter_create', $newItem);
-    }
-
-    public function test_create_applies_correct_priority()
-    {
-        $this->actingAsApiEditor();
-        $book = $this->entities->book();
-        $details = [
-            'name'        => 'My API chapter',
-            'description' => 'A chapter created via the API',
-            'book_id'     => $book->id,
-            'tags'        => [
-                [
-                    'name'  => 'tagname',
-                    'value' => 'tagvalue',
-                ],
-            ],
-            'priority'     => 15,
+            'priority' => 15,
         ];
 
         $resp = $this->postJson($this->baseEndpoint, $details);