mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Applied StyleCi changes, updated php deps
This commit is contained in:
@@ -374,7 +374,7 @@ class OidcTest extends TestCase
|
||||
$resp = $this->runLogin([
|
||||
'email' => 'benny@example.com',
|
||||
'sub' => 'benny1010101',
|
||||
'groups' => ['Wizards', 'Zookeepers']
|
||||
'groups' => ['Wizards', 'Zookeepers'],
|
||||
]);
|
||||
$resp->assertRedirect('/');
|
||||
|
||||
@@ -398,13 +398,13 @@ class OidcTest extends TestCase
|
||||
$resp = $this->runLogin([
|
||||
'email' => 'benny@example.com',
|
||||
'sub' => 'benny1010101',
|
||||
'my' => [
|
||||
'my' => [
|
||||
'custom' => [
|
||||
'groups' => [
|
||||
'attr' => ['Wizards']
|
||||
]
|
||||
]
|
||||
]
|
||||
'attr' => ['Wizards'],
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
$resp->assertRedirect('/');
|
||||
|
||||
|
@@ -23,10 +23,10 @@ class RegenerateReferencesCommandTest extends TestCase
|
||||
->assertExitCode(0);
|
||||
|
||||
$this->assertDatabaseHas('references', [
|
||||
'from_id' => $page->id,
|
||||
'from_id' => $page->id,
|
||||
'from_type' => $page->getMorphClass(),
|
||||
'to_id' => $book->id,
|
||||
'to_type' => $book->getMorphClass(),
|
||||
'to_id' => $book->id,
|
||||
'to_type' => $book->getMorphClass(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@@ -2,14 +2,12 @@
|
||||
|
||||
namespace Tests\References;
|
||||
|
||||
use BookStack\Entities\Models\Book;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\References\CrossLinkParser;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CrossLinkParserTest extends TestCase
|
||||
{
|
||||
|
||||
public function test_instance_with_entity_resolvers_matches_entity_links()
|
||||
{
|
||||
$entities = $this->getEachEntityType();
|
||||
@@ -17,7 +15,7 @@ class CrossLinkParserTest extends TestCase
|
||||
|
||||
$html = '
|
||||
<a href="' . url('/link/' . $otherPage->id) . '#cat">Page Permalink</a>
|
||||
<a href="' . $entities['page'] ->getUrl(). '?a=b">Page Link</a>
|
||||
<a href="' . $entities['page']->getUrl() . '?a=b">Page Link</a>
|
||||
<a href="' . $entities['chapter']->getUrl() . '?cat=mouse#donkey">Chapter Link</a>
|
||||
<a href="' . $entities['book']->getUrl() . '/edit">Book Link</a>
|
||||
<a href="' . $entities['bookshelf']->getUrl() . '/edit?cat=happy#hello">Shelf Link</a>
|
||||
|
@@ -12,7 +12,6 @@ use Tests\TestCase;
|
||||
|
||||
class ReferencesTest extends TestCase
|
||||
{
|
||||
|
||||
public function test_references_created_on_page_update()
|
||||
{
|
||||
/** @var Page $pageA */
|
||||
@@ -24,14 +23,14 @@ class ReferencesTest extends TestCase
|
||||
|
||||
$this->asEditor()->put($pageA->getUrl(), [
|
||||
'name' => 'Reference test',
|
||||
'html' => '<a href="' . $pageB->getUrl() . '">Testing</a>'
|
||||
'html' => '<a href="' . $pageB->getUrl() . '">Testing</a>',
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('references', [
|
||||
'from_id' => $pageA->id,
|
||||
'from_id' => $pageA->id,
|
||||
'from_type' => $pageA->getMorphClass(),
|
||||
'to_id' => $pageB->id,
|
||||
'to_type' => $pageB->getMorphClass(),
|
||||
'to_id' => $pageB->id,
|
||||
'to_type' => $pageB->getMorphClass(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -141,7 +140,7 @@ class ReferencesTest extends TestCase
|
||||
$this->assertStringContainsString('href="http://localhost/books/my-updated-book-slugaroo"', $page->html);
|
||||
$this->assertDatabaseHas('page_revisions', [
|
||||
'page_id' => $page->id,
|
||||
'summary' => 'System auto-update of internal links'
|
||||
'summary' => 'System auto-update of internal links',
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -179,10 +178,9 @@ class ReferencesTest extends TestCase
|
||||
{
|
||||
(new Reference())->forceFill([
|
||||
'from_type' => $from->getMorphClass(),
|
||||
'from_id' => $from->id,
|
||||
'to_type' => $to->getMorphClass(),
|
||||
'to_id' => $to->id,
|
||||
'from_id' => $from->id,
|
||||
'to_type' => $to->getMorphClass(),
|
||||
'to_id' => $to->id,
|
||||
])->save();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user