Subiendo proyecto completo sin restricciones de git ignore

This commit is contained in:
Jose Sanchez
2023-08-17 11:44:02 -04:00
parent a0d4f5ba3b
commit 20f1c60600
19921 changed files with 2509159 additions and 45 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace GeneaLabs\LaravelSignInWithApple\Tests\Browser;
use GeneaLabs\LaravelSignInWithApple\Tests\BrowserTestCase;
use Laravel\Dusk\Browser;
class SignInWithAppleTest extends BrowserTestCase
{
public function testButtonIsRendered()
{
$this->browse(function (Browser $browser) {
$browser
->visit("/tests")
->assertSee("Sign in with Apple");
});
}
public function testRedirectShowsAppleIdLogin()
{
$this->browse(function (Browser $browser) {
$browser
->visit("/tests")
->click('#sign-in-with-apple')
->assertSee("Use your Apple ID to sign in to Test Service ID.");
});
}
}

View File

@@ -0,0 +1,8 @@
[
{
"level": "SEVERE",
"message": "http:\/\/127.0.0.1:8000\/favicon.ico - Failed to load resource: the server responded with a status of 404 (Not Found)",
"source": "network",
"timestamp": 1583082983760
}
]

View File

@@ -0,0 +1,8 @@
[
{
"level": "WARNING",
"message": "https:\/\/appleid.cdn-apple.com\/appleauth\/static\/jsj\/2086116106\/profile\/app.js 254 Mixed Content: The page at 'https:\/\/appleid.apple.com\/auth\/authorize?client_id=dev.test.service-id&redirect_uri=http%3A%2F%2Ftesting.dev%2Fsiwa-callback&scope=name%20email&response_type=code&response_mode=form_post&state=DCCb1UiYHkFyhepDPSMCvHorrEQPIfQL4vD7dMZl' was loaded over a secure connection, but contains a form that targets an insecure endpoint 'http:\/\/testing.dev\/siwa-callback'. This endpoint should be made available over a secure connection.",
"source": "security",
"timestamp": 1583082984883
}
]

View File

@@ -0,0 +1,10 @@
<?php
namespace GeneaLabs\LaravelSignInWithApple\Tests;
use Orchestra\Testbench\Dusk\TestCase;
abstract class BrowserTestCase extends TestCase
{
use CreatesApplication;
}

View File

@@ -0,0 +1,42 @@
<?php
namespace GeneaLabs\LaravelSignInWithApple\Tests;
use Illuminate\Contracts\Http\Kernel;
use Orchestra\Testbench\Dusk\Options;
use Illuminate\Session\Middleware\StartSession;
use Laravel\Socialite\SocialiteServiceProvider;
use GeneaLabs\LaravelSignInWithApple\Providers\ServiceProvider;
use GeneaLabs\LaravelSignInWithApple\Tests\Fixtures\Providers\TestingServiceProvider;
trait CreatesApplication
{
protected function setUp(): void
{
parent::setUp();
Options::withUI();
$this->artisan("view:clear");
$this->artisan("cache:clear");
$this->artisan("config:clear");
}
protected function getEnvironmentSetUp($app)
{
$app['config']->set('database.redis.client', "predis");
$app->make(Kernel::class)
->pushMiddleware(StartSession::class);
$app->make("view")
->addLocation(__DIR__ . "/Fixtures/resources/views");
}
protected function getPackageProviders($app)
{
return [
SocialiteServiceProvider::class,
ServiceProvider::class,
TestingServiceProvider::class,
];
}
}

View File

@@ -0,0 +1,12 @@
<?php
namespace GeneaLabs\LaravelSignInWithApple\Tests;
use Orchestra\Testbench\BrowserKit\TestCase;
abstract class FeatureTestCase extends TestCase
{
use CreatesApplication;
public $baseUrl = 'http://testing.dev';
}

View File

@@ -0,0 +1,21 @@
<?php
namespace GeneaLabs\LaravelSignInWithApple\Tests\Fixtures\Http\Controllers;
use Laravel\Socialite\Facades\Socialite;
class SiwaController
{
public function login()
{
return Socialite::driver("sign-in-with-apple")
->scopes(["name", "email"])
->redirect();
}
public function callback()
{
$user = Socialite::driver("sign-in-with-apple")
->user();
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace GeneaLabs\LaravelSignInWithApple\Tests\Fixtures\Providers;
use Illuminate\Support\ServiceProvider;
class TestingServiceProvider extends ServiceProvider
{
protected $defer = false;
public function boot()
{
//
}
public function register()
{
$this->loadRoutesFrom(__DIR__ . "/../routes/web.php");
}
}

View File

@@ -0,0 +1,10 @@
<! DOCTYPE html>
<html>
<head>
</head>
<body>
<div>
@signInWithApple("black", false, "sign-in", 6)
</div>
</body>
</html>

View File

@@ -0,0 +1,7 @@
<?php
use GeneaLabs\LaravelSignInWithApple\Tests\Fixtures\Http\Controllers\SiwaController;
Route::view("/tests", "tests");
Route::get("/siwa-login", SiwaController::class . "@login");
Route::post("/siwa-callback", SiwaController::class . "@callback");

View File

@@ -0,0 +1,10 @@
<?php
namespace GeneaLabs\LaravelSignInWithApple\Tests;
use Orchestra\Testbench\TestCase;
abstract class UnitTestCase extends TestCase
{
use CreatesApplication;
}