SuperSeller3000/tests/Unit/Domain/Order/CustomerTest.php
Simon Kuehn f55e96b094 chore: add tooling config, test bootstrap, env templates and docs
PHPUnit config (phpunit.dist.xml, bin/phpunit, bootstrap.php), PHP CS
Fixer config, .editorconfig. Separate .env.dev/.env.test templates.
Ollama tunnel setup script. Architecture and plan docs. Updated
application-layer unit tests to match current service signatures.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 22:44:16 +00:00

39 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Tests\Unit\Domain\Order;
use App\Domain\Order\Customer;
use PHPUnit\Framework\TestCase;
final class CustomerTest extends TestCase
{
public function testNewCustomerHasEmptyPlatformIds(): void
{
$customer = new Customer('Max Mustermann', 'max@example.com', []);
$this->assertSame([], $customer->getPlatformIds());
$this->assertNull($customer->getPlatformId('ebay'));
}
public function testAddPlatformId(): void
{
$customer = new Customer('Max Mustermann', 'max@example.com', []);
$customer->addPlatformId('ebay', 'ebay-user-123');
$this->assertSame('ebay-user-123', $customer->getPlatformId('ebay'));
}
public function testMatchingKeyIsLowercaseNormalized(): void
{
$customer = new Customer('Max Mustermann', 'max@example.com', [
'street' => 'Musterstraße 1',
'city' => 'Berlin',
'zip' => '10115',
]);
$expected = 'max mustermann|musterstraße 1|berlin|10115';
$this->assertSame($expected, $customer->getMatchingKey());
}
}