feature: Initial commit

This commit is contained in:
Keith Solomon
2026-04-13 20:06:32 -05:00
commit 351dc06ec4
38 changed files with 8138 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
<?php
/**
* Logo sanitizer tests.
*
* @package LogoSoup\Tests
*/
use LogoSoup\Support\Logo_Sanitizer;
use PHPUnit\Framework\TestCase;
/**
* Tests collection sanitization.
*/
class LogoSanitizerTest extends TestCase {
/**
* Test invalid rows are removed.
*
* @return void
*/
public function test_sanitize_collection_skips_invalid_entries() {
$sanitized = Logo_Sanitizer::sanitize_collection(
array(
array(
'id' => '4',
'url' => 'https://example.com/logo.svg',
'alt' => '<b>Alpha</b>',
'link' => 'https://example.com',
),
array(
'alt' => 'Missing URL',
),
)
);
$this->assertCount( 1, $sanitized );
$this->assertSame( 'Alpha', $sanitized[0]['alt'] );
$this->assertSame( 4, $sanitized[0]['id'] );
}
}