Skip to content

Commit f3eb1ad

Browse files
committed
Improve tests and Travis CI fix
1 parent eed8213 commit f3eb1ad

File tree

4 files changed

+30
-75
lines changed

4 files changed

+30
-75
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: php
22
php:
3-
- 7.3
3+
- 7.4
44
before_install:
55
- composer self-update
66
install: composer install --dev

composer.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
"lightsaml/lightsaml": "^1.1",
2929
"phpunit/phpunit": "^9.0",
3030
"satooshi/php-coveralls": "^1.0",
31-
"laminas/laminas-diactoros": "^2.0",
32-
"pimple/pimple": "^3.2"
31+
"laminas/laminas-diactoros": "^2.0"
3332
},
3433
"suggest": {
3534
"lightsaml/lightsaml": "If you want to use SAML authentication you should manually install this package."

composer.lock

+4-54
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/src/LoginPolicyTest.php

+24-18
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,35 @@ public function testValidUsernameFormat()
4040
);
4141
}
4242

43-
// /**
44-
// * Test if flags are properly cast to boolean values.
45-
// */
46-
// public function testFlagsAreCasterToBool()
47-
// {
48-
// $this->assertSame(true, (new LoginPolicy())->setRememberExtendsSession('1')->rememberExtendsSession());
49-
// $this->assertSame(true, (new LoginPolicy())->setIsPasswordChangeEnabled(1)->isPasswordChangeEnabled());
50-
// $this->assertSame(true, (new LoginPolicy())->setIsPasswordRecoveryEnabled('YES')->isPasswordRecoveryEnabled());
51-
//
52-
// $this->assertSame(false, (new LoginPolicy())->setRememberExtendsSession('0')->rememberExtendsSession());
53-
// $this->assertSame(false, (new LoginPolicy())->setIsPasswordChangeEnabled(0)->isPasswordChangeEnabled());
54-
// $this->assertSame(false, (new LoginPolicy())->setIsPasswordRecoveryEnabled('0')->isPasswordRecoveryEnabled());
55-
// }
56-
5743
/**
5844
* Test if system accepts URLs or NULL.
5945
*/
6046
public function testValidUrlsOrNull()
6147
{
62-
$this->assertSame('https://www.activecollab.com/login', (new LoginPolicy())->setExternalLoginUrl('https://www.activecollab.com/login')->getExternalLoginUrl());
63-
$this->assertSame('https://www.activecollab.com/logout', (new LoginPolicy())->setExternalLogoutUrl('https://www.activecollab.com/logout')->getExternalLogoutUrl());
64-
$this->assertSame('https://www.activecollab.com/password', (new LoginPolicy())->setExternalChangePasswordUrl('https://www.activecollab.com/password')->getExternalChangePasswordUrl());
65-
$this->assertSame('https://www.activecollab.com/profile', (new LoginPolicy())->setExternalUpdateProfileUrl('https://www.activecollab.com/profile')->getExternalUpdateProfileUrl());
48+
$this->assertSame(
49+
'https://www.activecollab.com/login',
50+
(new LoginPolicy())
51+
->setExternalLoginUrl('https://www.activecollab.com/login')
52+
->getExternalLoginUrl()
53+
);
54+
$this->assertSame(
55+
'https://www.activecollab.com/logout',
56+
(new LoginPolicy())
57+
->setExternalLogoutUrl('https://www.activecollab.com/logout')
58+
->getExternalLogoutUrl()
59+
);
60+
$this->assertSame(
61+
'https://www.activecollab.com/password',
62+
(new LoginPolicy())
63+
->setExternalChangePasswordUrl('https://www.activecollab.com/password')
64+
->getExternalChangePasswordUrl()
65+
);
66+
$this->assertSame(
67+
'https://www.activecollab.com/profile',
68+
(new LoginPolicy())
69+
->setExternalUpdateProfileUrl('https://www.activecollab.com/profile')
70+
->getExternalUpdateProfileUrl()
71+
);
6672

6773
$this->assertNull((new LoginPolicy())->setExternalLoginUrl(null)->getExternalLoginUrl());
6874
$this->assertNull((new LoginPolicy())->setExternalLogoutUrl(null)->getExternalLogoutUrl());

0 commit comments

Comments
 (0)