Merge branch 'develop' into feature/activitystreams
This commit is contained in:
commit
d33793df14
5 changed files with 10 additions and 66 deletions
|
@ -43,7 +43,7 @@ class AppServiceProvider extends ServiceProvider
|
||||||
$tag = Tag::firstOrCreate(['tag' => $tag]);
|
$tag = Tag::firstOrCreate(['tag' => $tag]);
|
||||||
$tagsToAdd[] = $tag->id;
|
$tagsToAdd[] = $tag->id;
|
||||||
}
|
}
|
||||||
if (count($tagsToAdd > 0)) {
|
if (count($tagsToAdd) > 0) {
|
||||||
$note->tags()->attach($tagsToAdd);
|
$note->tags()->attach($tagsToAdd);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
11
helpers.php
11
helpers.php
|
@ -16,6 +16,7 @@ if (! function_exists('normalize_url')) {
|
||||||
$newUrl = '';
|
$newUrl = '';
|
||||||
$url = parse_url($url);
|
$url = parse_url($url);
|
||||||
$defaultSchemes = ['http' => 80, 'https' => 443];
|
$defaultSchemes = ['http' => 80, 'https' => 443];
|
||||||
|
|
||||||
if (isset($url['scheme'])) {
|
if (isset($url['scheme'])) {
|
||||||
$url['scheme'] = strtolower($url['scheme']);
|
$url['scheme'] = strtolower($url['scheme']);
|
||||||
// Strip scheme default ports
|
// Strip scheme default ports
|
||||||
|
@ -27,10 +28,12 @@ if (! function_exists('normalize_url')) {
|
||||||
}
|
}
|
||||||
$newUrl .= "{$url['scheme']}://";
|
$newUrl .= "{$url['scheme']}://";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($url['host'])) {
|
if (isset($url['host'])) {
|
||||||
$url['host'] = mb_strtolower($url['host']);
|
$url['host'] = mb_strtolower($url['host']);
|
||||||
$newUrl .= $url['host'];
|
$newUrl .= $url['host'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($url['port'])) {
|
if (isset($url['port'])) {
|
||||||
$newUrl .= ":{$url['port']}";
|
$newUrl .= ":{$url['port']}";
|
||||||
}
|
}
|
||||||
|
@ -63,10 +66,14 @@ if (! function_exists('normalize_url')) {
|
||||||
}
|
}
|
||||||
$url['path'] = preg_replace_callback(
|
$url['path'] = preg_replace_callback(
|
||||||
array_map(
|
array_map(
|
||||||
create_function('$str', 'return "/%" . strtoupper($str) . "/x";'),
|
function ($str) {
|
||||||
|
return "/%" . strtoupper($str) . "/x";
|
||||||
|
},
|
||||||
$u
|
$u
|
||||||
),
|
),
|
||||||
create_function('$matches', 'return chr(hexdec($matches[0]));'),
|
function ($matches) {
|
||||||
|
return chr(hexdec($matches[0]));
|
||||||
|
},
|
||||||
$url['path']
|
$url['path']
|
||||||
);
|
);
|
||||||
// Remove directory index
|
// Remove directory index
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Tests\Browser;
|
|
||||||
|
|
||||||
use Tests\DuskTestCase;
|
|
||||||
use Laravel\Dusk\Browser;
|
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
|
||||||
|
|
||||||
class ExampleTest extends DuskTestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* A basic browser test example.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function test_basic_example()
|
|
||||||
{
|
|
||||||
$this->browse(function (Browser $browser) {
|
|
||||||
$browser->visit('/')
|
|
||||||
->assertSee('Built with love');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Tests\Feature;
|
|
||||||
|
|
||||||
use Tests\TestCase;
|
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
||||||
|
|
||||||
class ExampleTest extends TestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* A basic test example.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function testBasicTest()
|
|
||||||
{
|
|
||||||
$response = $this->get('/');
|
|
||||||
|
|
||||||
$response->assertStatus(200);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Tests\Unit;
|
|
||||||
|
|
||||||
use Tests\TestCase;
|
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
||||||
|
|
||||||
class ExampleTest extends TestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* A basic test example.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function testBasicTest()
|
|
||||||
{
|
|
||||||
$this->assertTrue(true);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue