-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy Default user info layout provider (from core-library)
- Loading branch information
Showing
2 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
lib/common/Provider/Layout/DefaultUserInfoLayoutProvider.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
/* | ||
* This file is part of the jquery-datatables-bundle package. | ||
* | ||
* (c) 2018 WEBEWEB | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace WBW\Bundle\CommonBundle\Provider\Layout; | ||
|
||
/** | ||
* Default user info layout provider. | ||
* | ||
* @author webeweb <https://github.com/webeweb> | ||
* @package WBW\Bundle\CommonBundle\Provider\Layout | ||
*/ | ||
class DefaultUserInfoLayoutProvider implements UserInfoLayoutProviderInterface { | ||
|
||
/** | ||
* Constructor. | ||
*/ | ||
public function __construct() { | ||
// NOTHING TO DO | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function provideRegisterLink(): ?bool { | ||
return false; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function provideResettingLink(): ?bool { | ||
return false; | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
lib/common/Tests/Provider/Layout/DefaultUserInfoLayoutProviderTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
/* | ||
* This file is part of the jquery-datatables-bundle package. | ||
* | ||
* (c) 2018 WEBEWEB | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace WBW\Bundle\CommonBundle\Tests\Provider\Layout; | ||
|
||
use WBW\Bundle\CommonBundle\Provider\Layout\DefaultUserInfoLayoutProvider; | ||
use WBW\Bundle\CommonBundle\Provider\Layout\UserInfoLayoutProviderInterface; | ||
use WBW\Bundle\CommonBundle\Provider\LayoutProviderInterface; | ||
use WBW\Bundle\CommonBundle\Tests\AbstractTestCase; | ||
|
||
/** | ||
* Default user info layout provider test. | ||
* | ||
* @author webeweb <https://github.com/webeweb> | ||
* @package WBW\Bundle\CommonBundle\Tests\Layout | ||
*/ | ||
class DefaultUserInfoLayoutProviderTest extends AbstractTestCase { | ||
|
||
/** | ||
* Test provideRegisterLink() | ||
* | ||
* @return void | ||
*/ | ||
public function testProvideRegisterLink(): void { | ||
|
||
$obj = new DefaultUserInfoLayoutProvider(); | ||
|
||
$this->assertFalse($obj->provideRegisterLink()); | ||
} | ||
|
||
/** | ||
* Test provideResettingLink() | ||
* | ||
* @return void | ||
*/ | ||
public function testProvideResettingLink(): void { | ||
|
||
$obj = new DefaultUserInfoLayoutProvider(); | ||
|
||
$this->assertFalse($obj->provideResettingLink()); | ||
} | ||
|
||
/** | ||
* Test __construct() | ||
* | ||
* @return void | ||
*/ | ||
public function test__construct(): void { | ||
|
||
$obj = new DefaultUserInfoLayoutProvider(); | ||
|
||
$this->assertInstanceOf(LayoutProviderInterface::class, $obj); | ||
$this->assertInstanceOf(UserInfoLayoutProviderInterface::class, $obj); | ||
} | ||
} |