Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
bec4d351
Commit
bec4d351
authored
10 years ago
by
Jaime Perez Crespo
Browse files
Options
Downloads
Patches
Plain Diff
Do not use assertEquals(true|false) but assertTrue() or assertFalse() instead.
parent
b7bf7242
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/Utils/Net.php
+15
-15
15 additions, 15 deletions
tests/Utils/Net.php
with
15 additions
and
15 deletions
tests/Utils/Net.php
+
15
−
15
View file @
bec4d351
...
@@ -13,29 +13,29 @@ class Utils_Net extends PHPUnit_Framework_TestCase
...
@@ -13,29 +13,29 @@ class Utils_Net extends PHPUnit_Framework_TestCase
public
function
testIpCIDRcheck
()
public
function
testIpCIDRcheck
()
{
{
// check CIDR w/o mask
// check CIDR w/o mask
$this
->
assert
Equals
(
f
alse
,
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0'
,
'127.0.0.1'
));
$this
->
assert
F
alse
(
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0'
,
'127.0.0.1'
));
// check wrong CIDR w/ mask
// check wrong CIDR w/ mask
$this
->
assert
Equals
(
f
alse
,
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.256/24'
,
'127.0.0.1'
));
$this
->
assert
F
alse
(
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.256/24'
,
'127.0.0.1'
));
// check wrong IP
// check wrong IP
$this
->
assert
Equals
(
false
,
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/24'
,
'127.0.0'
));
$this
->
assert
True
(
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/24'
,
'127.0.0'
));
$this
->
assert
Equals
(
false
,
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/24'
,
'127.0.0.*'
));
$this
->
assert
True
(
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/24'
,
'127.0.0.*'
));
// check limits for standard classes
// check limits for standard classes
$this
->
assert
Equals
(
true
,
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/24'
,
'127.0.0.0'
));
$this
->
assert
True
(
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/24'
,
'127.0.0.0'
));
$this
->
assert
Equals
(
true
,
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/24'
,
'127.0.0.255'
));
$this
->
assert
True
(
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/24'
,
'127.0.0.255'
));
$this
->
assert
Equals
(
f
alse
,
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/24'
,
'127.0.0.256'
));
$this
->
assert
F
alse
(
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/24'
,
'127.0.0.256'
));
$this
->
assert
Equals
(
true
,
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/16'
,
'127.0.0.0'
));
$this
->
assert
True
(
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/16'
,
'127.0.0.0'
));
$this
->
assert
Equals
(
true
,
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/16'
,
'127.0.255.255'
));
$this
->
assert
True
(
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/16'
,
'127.0.255.255'
));
$this
->
assert
Equals
(
f
alse
,
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/16'
,
'127.0.255.256'
));
$this
->
assert
F
alse
(
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/16'
,
'127.0.255.256'
));
$this
->
assert
Equals
(
f
alse
,
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/16'
,
'127.0.256.255'
));
$this
->
assert
F
alse
(
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/16'
,
'127.0.256.255'
));
// check limits for non-standard classes
// check limits for non-standard classes
$this
->
assert
Equals
(
true
,
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/23'
,
'127.0.0.0'
));
$this
->
assert
True
(
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/23'
,
'127.0.0.0'
));
$this
->
assert
Equals
(
true
,
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/23'
,
'127.0.1.255'
));
$this
->
assert
True
(
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/23'
,
'127.0.1.255'
));
$this
->
assert
Equals
(
f
alse
,
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/23'
,
'127.0.1.256'
));
$this
->
assert
F
alse
(
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/23'
,
'127.0.1.256'
));
$this
->
assert
Equals
(
f
alse
,
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/23'
,
'127.0.2.0'
));
$this
->
assert
F
alse
(
SimpleSAML_Utils_Net
::
ipCIDRcheck
(
'127.0.0.0/23'
,
'127.0.2.0'
));
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment