mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
Apply fixes from StyleCI (#695)
This commit is contained in:
parent
d2a535bcc1
commit
88d2d4fbe8
13 changed files with 423 additions and 427 deletions
|
@ -10,7 +10,7 @@ class FileTest extends TestCase
|
|||
/** @test */
|
||||
public function file_info_is_retrieved_correctly()
|
||||
{
|
||||
$file = new File(__DIR__ . '/../../songs/full.mp3');
|
||||
$file = new File(__DIR__.'/../../songs/full.mp3');
|
||||
$info = $file->getInfo();
|
||||
|
||||
$expectedData = [
|
||||
|
@ -22,7 +22,7 @@ class FileTest extends TestCase
|
|||
'disc' => 3,
|
||||
'lyrics' => "Foo\rbar",
|
||||
'cover' => [
|
||||
'data' => file_get_contents(__DIR__ . '/../../blobs/cover.png'),
|
||||
'data' => file_get_contents(__DIR__.'/../../blobs/cover.png'),
|
||||
'image_mime' => 'image/png',
|
||||
'image_width' => 512,
|
||||
'image_height' => 512,
|
||||
|
@ -31,8 +31,8 @@ class FileTest extends TestCase
|
|||
'description' => '',
|
||||
'datalength' => 7627,
|
||||
],
|
||||
'path' => __DIR__ . '/../../songs/full.mp3',
|
||||
'mtime' => filemtime(__DIR__ . '/../../songs/full.mp3'),
|
||||
'path' => __DIR__.'/../../songs/full.mp3',
|
||||
'mtime' => filemtime(__DIR__.'/../../songs/full.mp3'),
|
||||
'albumartist' => '',
|
||||
];
|
||||
|
||||
|
@ -43,7 +43,7 @@ class FileTest extends TestCase
|
|||
/** @test */
|
||||
public function song_without_a_title_tag_has_file_name_as_the_title()
|
||||
{
|
||||
$file = new File(__DIR__ . '/../../songs/blank.mp3');
|
||||
$file = new File(__DIR__.'/../../songs/blank.mp3');
|
||||
$this->assertSame('blank', $file->getInfo()['title']);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ class InteractionTest extends TestCase
|
|||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function it_toggles_like_status()
|
||||
|
@ -49,6 +50,7 @@ class InteractionTest extends TestCase
|
|||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function user_can_like_multiple_songs_at_once()
|
||||
|
@ -71,6 +73,7 @@ class InteractionTest extends TestCase
|
|||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function user_can_unlike_multiple_songs_at_once()
|
||||
|
|
|
@ -7,7 +7,6 @@ use Tests\TestCase;
|
|||
|
||||
class SettingTest extends TestCase
|
||||
{
|
||||
|
||||
/** @test */
|
||||
public function it_sets_a_key_value_pair()
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@ class SongZipArchiveTest extends TestCase
|
|||
{
|
||||
// Given a song
|
||||
$song = factory(Song::class)->create([
|
||||
'path' => realpath(__DIR__ . '/../../songs/full.mp3'),
|
||||
'path' => realpath(__DIR__.'/../../songs/full.mp3'),
|
||||
]);
|
||||
|
||||
// When I add the song into the archive
|
||||
|
@ -34,10 +34,10 @@ class SongZipArchiveTest extends TestCase
|
|||
// Given some songs
|
||||
$songs = collect([
|
||||
factory(Song::class)->create([
|
||||
'path' => realpath(__DIR__ . '/../../songs/full.mp3'),
|
||||
'path' => realpath(__DIR__.'/../../songs/full.mp3'),
|
||||
]),
|
||||
factory(Song::class)->create([
|
||||
'path' => realpath(__DIR__ . '/../../songs/lorem.mp3'),
|
||||
'path' => realpath(__DIR__.'/../../songs/lorem.mp3'),
|
||||
]),
|
||||
]);
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ use Tests\TestCase;
|
|||
|
||||
class UserTest extends TestCase
|
||||
{
|
||||
|
||||
/** @test */
|
||||
public function user_preferences_can_be_set()
|
||||
{
|
||||
|
|
|
@ -20,6 +20,7 @@ class LastfmTest extends TestCase
|
|||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function it_returns_artist_info_if_artist_is_found_on_lastfm()
|
||||
|
@ -71,6 +72,7 @@ class LastfmTest extends TestCase
|
|||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function it_returns_album_info_if_album_is_found_on_lastfm()
|
||||
|
|
|
@ -50,6 +50,7 @@ class MediaCacheTest extends TestCase
|
|||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function it_does_not_cache_queried_data_if_cache_media_is_configured_to_false()
|
||||
|
|
|
@ -18,6 +18,7 @@ class iTunesTest extends TestCase
|
|||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function it_gets_itunes_track_url()
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
namespace Tests\Unit\Models;
|
||||
|
||||
use App\Models\Artist;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use org\bovigo\vfs\vfsStream;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ArtistTest extends TestCase
|
||||
|
|
|
@ -11,9 +11,9 @@ class FileTest extends TestCase
|
|||
/** @test */
|
||||
public function it_can_be_instantiated()
|
||||
{
|
||||
$file = new File(__DIR__ . '/../songs/full.mp3');
|
||||
$file = new File(__DIR__.'/../songs/full.mp3');
|
||||
$this->assertInstanceOf(File::class, $file);
|
||||
$file = new File(new SplFileInfo(__DIR__ . '/../songs/full.mp3'));
|
||||
$file = new File(new SplFileInfo(__DIR__.'/../songs/full.mp3'));
|
||||
$this->assertInstanceOf(File::class, $file);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,11 +2,7 @@
|
|||
|
||||
namespace Tests\Unit\Models;
|
||||
|
||||
use App\Events\SongLikeToggled;
|
||||
use App\Models\Interaction;
|
||||
use App\Models\Song;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Collection;
|
||||
use Tests\TestCase;
|
||||
|
||||
class InteractionTest extends TestCase
|
||||
|
@ -16,5 +12,4 @@ class InteractionTest extends TestCase
|
|||
{
|
||||
$this->assertInstanceOf(Interaction::class, new Interaction());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Tests\Unit\Models;
|
||||
|
||||
use App\Models\Song;
|
||||
use App\Models\SongZipArchive;
|
||||
use Tests\TestCase;
|
||||
|
||||
|
|
|
@ -12,5 +12,4 @@ class UserTest extends TestCase
|
|||
{
|
||||
$this->assertInstanceOf(User::class, new User());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue