-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing H5P content type icons caused by h5p-editor library downg…
…rade. Add tests
- Loading branch information
Showing
6 changed files
with
245 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
sourcecode/apis/contentauthor/database/factories/H5PLibrariesHubCacheFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Database\Factories; | ||
|
||
use App\H5PLibrariesHubCache; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
||
/** | ||
* @template-extends Factory<H5PLibrariesHubCache> | ||
*/ | ||
class H5PLibrariesHubCacheFactory extends Factory | ||
{ | ||
public function definition(): array | ||
{ | ||
return [ | ||
'name' => 'H5P.Foobar', | ||
'major_version' => 2, | ||
'minor_version' => 4, | ||
'patch_version' => 6, | ||
'h5p_major_version' => 1, | ||
'h5p_minor_version' => 25, | ||
'title' => $this->faker->words(3, true), | ||
'summary' => $this->faker->sentence, | ||
'description' => $this->faker->sentences(3, true), | ||
'icon' => $this->faker->url . '/icon.svg', | ||
'is_recommended' => 0, | ||
'popularity' => $this->faker->numberBetween(0, 100000), | ||
'screenshots' => json_encode([ | ||
$this->faker->url . '/image01.jpg', | ||
$this->faker->url . '/image02.jpg', | ||
$this->faker->url . '/image03.jpg', | ||
]), | ||
'license' => '{"id":"MIT","attributes":{"useCommercially":true,"modifiable":true,"distributable":true,"sublicensable":true,"canHoldLiable":false,"mustIncludeCopyright":true,"mustIncludeLicense":true}}', | ||
'example' => $this->faker->url, | ||
'tutorial' => $this->faker->url, | ||
'keywords' => json_encode($this->faker->words()), | ||
'categories' => '["Other"]', | ||
'owner' => $this->faker->userName, | ||
]; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
sourcecode/apis/contentauthor/database/factories/H5PLibraryCapabilityFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Database\Factories; | ||
|
||
use App\H5PLibraryCapability; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
||
/** | ||
* @template-extends Factory<H5PLibraryCapability> | ||
*/ | ||
class H5PLibraryCapabilityFactory extends Factory | ||
{ | ||
public function definition(): array | ||
{ | ||
return [ | ||
'library_id' => $this->faker->numberBetween(), | ||
'name' => 'H5P.Foobar 1.2', | ||
'score' => 0, | ||
'enabled' => 1, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters