syncByWatchRecord() 공개 메소드

Sync media using a watch record.
public syncByWatchRecord ( App\Libraries\WatchRecord\WatchRecordInterface $record, SyncMedia $syncCommand = null )
$record App\Libraries\WatchRecord\WatchRecordInterface The watch record.
$syncCommand App\Console\Commands\SyncMedia The SyncMedia command object, to log to console if executed by artisan.
예제 #1
0
 public function testWatchDirectoryDeleted()
 {
     $this->expectsEvents(LibraryChanged::class);
     $media = new Media();
     $media->sync($this->mediaPath);
     $media->syncByWatchRecord(new InotifyWatchRecord("MOVED_FROM,ISDIR {$this->mediaPath}/subdir"));
     $this->notSeeInDatabase('songs', ['path' => $this->mediaPath . '/subdir/sic.mp3']);
     $this->notSeeInDatabase('songs', ['path' => $this->mediaPath . '/subdir/no-name.MP3']);
     $this->notSeeInDatabase('songs', ['path' => $this->mediaPath . '/subdir/back-in-black.mp3']);
 }