Fix test output
This commit is contained in:
parent
1c772e63cb
commit
d59128871e
4 changed files with 45 additions and 51 deletions
|
|
@ -325,7 +325,7 @@ public function test_create_route_validates_required_fields()
|
||||||
|
|
||||||
public function test_create_route_creates_route_successfully()
|
public function test_create_route_creates_route_successfully()
|
||||||
{
|
{
|
||||||
$language = Language::first() ?? Language::factory()->create();
|
$language = Language::first();
|
||||||
$feed = Feed::factory()->language($language)->create();
|
$feed = Feed::factory()->language($language)->create();
|
||||||
$platformChannel = PlatformChannel::factory()->create();
|
$platformChannel = PlatformChannel::factory()->create();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,8 @@
|
||||||
namespace Tests\Unit\Modules\Lemmy\Services;
|
namespace Tests\Unit\Modules\Lemmy\Services;
|
||||||
|
|
||||||
use App\Modules\Lemmy\Services\LemmyApiService;
|
use App\Modules\Lemmy\Services\LemmyApiService;
|
||||||
use App\Modules\Lemmy\LemmyRequest;
|
|
||||||
use App\Models\PlatformChannelPost;
|
use App\Models\PlatformChannelPost;
|
||||||
use App\Enums\PlatformEnum;
|
use App\Enums\PlatformEnum;
|
||||||
use Illuminate\Http\Client\Response;
|
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,6 @@
|
||||||
use App\Services\Article\ArticleFetcher;
|
use App\Services\Article\ArticleFetcher;
|
||||||
use App\Models\Feed;
|
use App\Models\Feed;
|
||||||
use App\Models\Article;
|
use App\Models\Article;
|
||||||
use App\Services\Http\HttpFetcher;
|
|
||||||
use App\Services\Factories\HomepageParserFactory;
|
|
||||||
use App\Services\Factories\ArticleParserFactory;
|
|
||||||
use App\Services\Log\LogSaver;
|
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
|
|
@ -24,7 +20,7 @@ protected function setUp(): void
|
||||||
|
|
||||||
// Mock all HTTP requests by default to prevent external calls
|
// Mock all HTTP requests by default to prevent external calls
|
||||||
Http::fake([
|
Http::fake([
|
||||||
'*' => Http::response('', 500)
|
'*' => Http::response('<html><body>Mock HTML content</body></html>', 200)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -148,7 +144,7 @@ public function test_get_articles_from_website_feed_with_supported_parser(): voi
|
||||||
|
|
||||||
public function test_get_articles_from_website_feed_handles_invalid_url(): void
|
public function test_get_articles_from_website_feed_handles_invalid_url(): void
|
||||||
{
|
{
|
||||||
// HTTP mock already set in setUp() to return 500 for all requests
|
// HTTP mock already set in setUp() to return mock HTML for all requests
|
||||||
|
|
||||||
$feed = Feed::factory()->create([
|
$feed = Feed::factory()->create([
|
||||||
'type' => 'website',
|
'type' => 'website',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue