Skip to content

Commit 91c9249

Browse files
committed
feat: attributed orm mapping - DisqusSSOProfile mapping unit test
Signed-off-by: romanetar <roman_ag@hotmail.com>
1 parent 53caf7e commit 91c9249

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php namespace Tests\unit;
2+
3+
/**
4+
* Copyright 2025 OpenStack Foundation
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
**/
15+
16+
use App\Models\SSO\DisqusSSOProfile;
17+
use LaravelDoctrine\ORM\Facades\EntityManager;
18+
use Tests\BrowserKitTestCase;
19+
20+
/**
21+
* Class DisqusSSOProfileMappingTest
22+
* @package Tests\unit
23+
*/
24+
class DisqusSSOProfileMappingTest extends BrowserKitTestCase
25+
{
26+
public function testDisqusSSOProfilePersistence()
27+
{
28+
$slug = 'poc_disqus';
29+
30+
$disqus_profile = new DisqusSSOProfile();
31+
$disqus_profile->setForumSlug($slug);
32+
$disqus_profile->setPublicKey("PUBLIC_KEY");
33+
$disqus_profile->setSecretKey("SECRET_KEY");
34+
35+
EntityManager::persist($disqus_profile);
36+
EntityManager::flush();
37+
EntityManager::clear();
38+
39+
$repo = EntityManager::getRepository(DisqusSSOProfile::class);
40+
$found_disqus_profile = $repo->find($disqus_profile->getId());
41+
42+
$this->assertInstanceOf(DisqusSSOProfile::class, $found_disqus_profile);
43+
$this->assertEquals($slug, $found_disqus_profile->getForumSlug());
44+
}
45+
}

0 commit comments

Comments
 (0)