Skip to content

Commit

Permalink
#43 Coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
j3nsch committed May 8, 2023
1 parent 0406327 commit bad0916
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/Rules/Conditions/AccountCondition.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
namespace Opus\Import\Rules\Conditions;

use Opus\Import\ImportRuleConditionInterface;
use Zend_Auth; // TODO SECURITY depend on OPUS classes instead
use Zend_Auth;

use function strcasecmp;

// TODO SECURITY depend on OPUS classes instead

class AccountCondition implements ImportRuleConditionInterface
{
Expand Down
8 changes: 5 additions & 3 deletions test/Rules/Conditions/AccountConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@
use OpusTest\Import\TestAsset\MockAuthAdapter;
use OpusTest\Import\TestAsset\TestCase;
use Zend_Auth;
use Zend_Auth_Storage_Interface;
use Zend_Auth_Storage_NonPersistent;

class AccountConditionTest extends TestCase
{
/** @var Zend_Auth_Storage_Interface */
private $authStorage;

public function setUp(): void
Expand All @@ -60,7 +62,7 @@ public function tearDown(): void
public function testConstruct()
{
$condition = new AccountCondition([
'account' => 'sword1'
'account' => 'sword1',
]);

$this->assertEquals('sword1', $condition->getExpectedUser());
Expand All @@ -71,7 +73,7 @@ public function testAppliesTrue()
Zend_Auth::getInstance()->authenticate(new MockAuthAdapter('sword1'));

$condition = new AccountCondition([
'account' => 'sword1'
'account' => 'sword1',
]);

$this->assertTrue($condition->applies());
Expand All @@ -82,7 +84,7 @@ public function testAppliesFalse()
Zend_Auth::getInstance()->authenticate(new MockAuthAdapter('sword2'));

$condition = new AccountCondition([
'account' => 'sword1'
'account' => 'sword1',
]);

$this->assertFalse($condition->applies());
Expand Down
2 changes: 1 addition & 1 deletion test/TestAsset/MockAuthAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct($user)
*/
public function authenticate()
{
$identity = ['username'=> $this->user];
$identity = ['username' => $this->user];
return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $identity);
}
}

0 comments on commit bad0916

Please sign in to comment.