Some small fixes needed for the tests
This commit is contained in:
parent
961b7d1acf
commit
b0ad1d272c
9 changed files with 780 additions and 645 deletions
1382
_ide_helper.php
1382
_ide_helper.php
File diff suppressed because it is too large
Load diff
|
@ -10,7 +10,7 @@ use App\Services\PlaceService;
|
|||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
use Phaza\LaravelPostgis\Geometries\Point;
|
||||
use MStaack\LaravelPostgis\Geometries\Point;
|
||||
|
||||
class PlacesController extends Controller
|
||||
{
|
||||
|
|
|
@ -17,7 +17,7 @@ use Intervention\Image\Exception\NotReadableException;
|
|||
use Intervention\Image\ImageManager;
|
||||
use Monolog\Handler\StreamHandler;
|
||||
use Monolog\Logger;
|
||||
use Phaza\LaravelPostgis\Geometries\Point;
|
||||
use MStaack\LaravelPostgis\Geometries\Point;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
|
||||
class MicropubController extends Controller
|
||||
|
|
|
@ -36,10 +36,10 @@ use MStaack\LaravelPostgis\Geometries\Point;
|
|||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Note[] $notes
|
||||
* @property-read int|null $notes_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Place findSimilarSlugs($attribute, $config, $slug)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Place near(\Phaza\LaravelPostgis\Geometries\Point $point, $distance = 1000)
|
||||
* @method static \Phaza\LaravelPostgis\Eloquent\Builder|\App\Models\Place newModelQuery()
|
||||
* @method static \Phaza\LaravelPostgis\Eloquent\Builder|\App\Models\Place newQuery()
|
||||
* @method static \Phaza\LaravelPostgis\Eloquent\Builder|\App\Models\Place query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Place near(\MStaack\LaravelPostgis\Geometries\Point $point, $distance = 1000)
|
||||
* @method static \MStaack\LaravelPostgis\Eloquent\Builder|\App\Models\Place newModelQuery()
|
||||
* @method static \MStaack\LaravelPostgis\Eloquent\Builder|\App\Models\Place newQuery()
|
||||
* @method static \MStaack\LaravelPostgis\Eloquent\Builder|\App\Models\Place query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Place whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Place whereDescription($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Place whereExternalURL($url)
|
||||
|
|
|
@ -6,7 +6,7 @@ namespace App\Services;
|
|||
|
||||
use App\Models\Place;
|
||||
use Illuminate\Support\Arr;
|
||||
use Phaza\LaravelPostgis\Geometries\Point;
|
||||
use MStaack\LaravelPostgis\Geometries\Point;
|
||||
|
||||
class PlaceService
|
||||
{
|
||||
|
|
|
@ -51,7 +51,7 @@ class ArticlesTest extends TestCase
|
|||
fclose($fh);
|
||||
}
|
||||
$path = sys_get_temp_dir() . '/article.md';
|
||||
$file = new UploadedFile($path, 'article.md', 'text/plain', filesize($path), null, true);
|
||||
$file = new UploadedFile($path, 'article.md', 'text/plain', null, true);
|
||||
|
||||
$this->actingAs($user)
|
||||
->post('/admin/blog', [
|
||||
|
|
|
@ -86,7 +86,7 @@ class ContactsTest extends TestCase
|
|||
{
|
||||
copy(__DIR__ . '/../../aaron.png', sys_get_temp_dir() . '/tantek.png');
|
||||
$path = sys_get_temp_dir() . '/tantek.png';
|
||||
$file = new UploadedFile($path, 'tantek.png', 'image/png', filesize($path), null, true);
|
||||
$file = new UploadedFile($path, 'tantek.png', 'image/png', null, true);
|
||||
$user = factory(User::class)->create();
|
||||
|
||||
$this->actingAs($user)->post('/admin/contacts/1', [
|
||||
|
|
|
@ -12,7 +12,7 @@ use Illuminate\Http\UploadedFile;
|
|||
use App\Jobs\SyndicateNoteToTwitter;
|
||||
use Illuminate\Support\Facades\Queue;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Phaza\LaravelPostgis\Geometries\Point;
|
||||
use MStaack\LaravelPostgis\Geometries\Point;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class MicropubControllerTest extends TestCase
|
||||
|
@ -697,14 +697,7 @@ class MicropubControllerTest extends TestCase
|
|||
$response = $this->post(
|
||||
'/api/media',
|
||||
[
|
||||
'file' => new UploadedFile(
|
||||
$file,
|
||||
'aaron.png',
|
||||
'image/png',
|
||||
filesize(__DIR__ . '/../aaron.png'),
|
||||
null,
|
||||
true
|
||||
),
|
||||
'file' => new UploadedFile($file, 'aaron.png', 'image/png', null, true),
|
||||
],
|
||||
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
||||
);
|
||||
|
@ -726,7 +719,7 @@ class MicropubControllerTest extends TestCase
|
|||
$response = $this->post(
|
||||
'/api/media',
|
||||
[
|
||||
'file' => new UploadedFile($file, 'audio.mp3', 'audio/mpeg', filesize($file), null, true),
|
||||
'file' => new UploadedFile($file, 'audio.mp3', 'audio/mpeg', null, true),
|
||||
],
|
||||
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
||||
);
|
||||
|
@ -748,7 +741,7 @@ class MicropubControllerTest extends TestCase
|
|||
$response = $this->post(
|
||||
'/api/media',
|
||||
[
|
||||
'file' => new UploadedFile($file, 'video.ogv', 'video/ogg', filesize($file), null, true),
|
||||
'file' => new UploadedFile($file, 'video.ogv', 'video/ogg', null, true),
|
||||
],
|
||||
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
||||
);
|
||||
|
@ -790,7 +783,13 @@ class MicropubControllerTest extends TestCase
|
|||
$response = $this->post(
|
||||
'/api/media',
|
||||
[
|
||||
'file' => new UploadedFile(__DIR__ . '/../aaron.png', 'aaron.png', 'image/png', UPLOAD_ERR_INI_SIZE, true),
|
||||
'file' => new UploadedFile(
|
||||
__DIR__ . '/../aaron.png',
|
||||
'aaron.png',
|
||||
'image/png',
|
||||
UPLOAD_ERR_INI_SIZE,
|
||||
true
|
||||
),
|
||||
],
|
||||
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
||||
);
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace Tests\Unit;
|
|||
use Tests\TestCase;
|
||||
use App\Models\Place;
|
||||
use App\Services\PlaceService;
|
||||
use Phaza\LaravelPostgis\Geometries\Point;
|
||||
use MStaack\LaravelPostgis\Geometries\Point;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue