ImageTest::test_image_upload PHP Method

test_image_upload() public method

public test_image_upload ( )
    public function test_image_upload()
    {
        $page = \BookStack\Page::first();
        $this->asAdmin();
        $admin = $this->getAdmin();
        $imageName = 'first-image.jpg';
        $relPath = $this->uploadImage($imageName, $page->id);
        $this->assertResponseOk();
        $this->assertTrue(file_exists(public_path($relPath)), 'Uploaded image not found at path: ' . public_path($relPath));
        $this->deleteImage($relPath);
        $this->seeInDatabase('images', ['url' => $this->baseUrl . $relPath, 'type' => 'gallery', 'uploaded_to' => $page->id, 'path' => $relPath, 'created_by' => $admin->id, 'updated_by' => $admin->id, 'name' => $imageName]);
    }