Skip to content

Commit

Permalink
not sure but did two things to start could not replicate the issue th…
Browse files Browse the repository at this point in the history
…ough
  • Loading branch information
alnutile committed Jun 12, 2023
1 parent 0597bb4 commit 7ec9878
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions app/helpers.php
@@ -1,6 +1,5 @@
<?php

use Illuminate\Support\Str;
use Illuminate\Support\Stringable;

if (! function_exists('remove_ascii')) {
Expand Down Expand Up @@ -29,7 +28,7 @@ function file_name_from_url(string $url): string
->when(! str($url)->endsWith('.html'), function (Stringable $string) {
return $string->append('.html');
})
->whenStartsWith(".", function($item) {
->whenStartsWith('.', function ($item) {
/** @var Stringable $item */
return $item->prepend('index');
})->toString();
Expand Down
7 changes: 3 additions & 4 deletions tests/Feature/Html2TextTest.php
Expand Up @@ -37,20 +37,19 @@ public function test_parses()

public function test_remove_unicode()
{
$contentBefore = <<<EOD
$contentBefore = <<<'EOD'
This should be here
This should be here
EOD;


$contentAfter = <<<EOD
$contentAfter = <<<'EOD'
This should be here This should be here
EOD;

$document = Document::factory()->html()->create([
'content' => $contentBefore,
'guid' => fake()->uuid . ".html"
'guid' => fake()->uuid.'.html',
]);

$transformerModel = Transformer::factory()->create([
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/ScrapeWebPageTest.php
Expand Up @@ -10,7 +10,6 @@

class ScrapeWebPageTest extends TestCase
{

public function test_deals_with_index_naming()
{
$source = Source::factory()->scrapeWebPage()->create(
Expand All @@ -33,9 +32,10 @@ public function test_deals_with_index_naming()

$document = Document::first();

$this->assertEquals("index.html", $document->guid);
$this->assertEquals('index.html', $document->guid);

}

public function test_saves_content()
{
$source = Source::factory()->scrapeWebPage()->create();
Expand Down

0 comments on commit 7ec9878

Please sign in to comment.