Skip to content

Commit

Permalink
Create a ProfileTest testing if the getters and setters of a profile …
Browse files Browse the repository at this point in the history
…work
  • Loading branch information
StijnVrolijk committed Mar 6, 2018
1 parent 0c74dc5 commit cad9074
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions src/Frontend/Modules/Profiles/Tests/Engine/ProfileTest.php
@@ -0,0 +1,60 @@
<?php

namespace Frontend\Modules\Profiles\Tests\Engine;

use Common\WebTestCase;
use Frontend\Modules\Profiles\Engine\Profile;

final class ProfileTest extends WebTestCase
{
public function setUp(): void
{
parent::setUp();

if (!defined('APPLICATION')) {
define('APPLICATION', 'Frontend');
}

$client = self::createClient();
$this->loadFixtures($client);
}

public function testCreatingProfile(): void
{
$profile = new Profile();

$profile->setDisplayName('Fork CMS');
$this->assertEquals('Fork CMS', $profile->getDisplayName());

$profile->setEmail('info@fork-cms.com');
$this->assertEquals('info@fork-cms.com', $profile->getEmail());

$profile->setRegisteredOn(1234567890);
$this->assertEquals(1234567890, $profile->getRegisteredOn());

$profile->setStatus('random_status');
$this->assertEquals('random_status', $profile->getStatus());

$profile->setUrl('fork-cms');
$this->assertEquals('fork-cms', $profile->getUrl());

// @TODO These settings setters don't work because the profile doesn't have an ID, this should be fixed
/*$profile->setSettings(
[
'my_first_setting' => 'My first value',
'my_second_setting' => 'My second value',
]
);
$this->assertEquals(
[
'my_first_setting' => 'My first value',
'my_second_setting' => 'My second value',
],
$profile->getSettings()
);
$this->assertEquals('My first value', $profile->getSetting('my_first_setting'));
$profile->setSetting('my_second_setting', 'My updated value');
$this->assertEquals('My updated value', $profile->getSetting('my_second_setting'));*/
}
}

0 comments on commit cad9074

Please sign in to comment.