Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
a4d3cc79
Commit
a4d3cc79
authored
12 years ago
by
Bart Visscher
Browse files
Options
Downloads
Patches
Plain Diff
Correct lib/public/contacts.php tests
parent
09a4424b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/public/contacts.php
+2
-2
2 additions, 2 deletions
lib/public/contacts.php
tests/lib/public/contacts.php
+4
-4
4 additions, 4 deletions
tests/lib/public/contacts.php
with
6 additions
and
6 deletions
lib/public/contacts.php
+
2
−
2
View file @
a4d3cc79
...
...
@@ -149,14 +149,14 @@ namespace OCP {
/**
* @param \OCP\IAddressBook $address_book
*/
public
static
function
registerAddressBook
(
$address_book
)
{
public
static
function
registerAddressBook
(
\OCP\IAddressBook
$address_book
)
{
self
::
$address_books
[
$address_book
->
getKey
()]
=
$address_book
;
}
/**
* @param \OCP\IAddressBook $address_book
*/
public
static
function
unregisterAddressBook
(
$address_book
)
{
public
static
function
unregisterAddressBook
(
\OCP\IAddressBook
$address_book
)
{
unset
(
self
::
$address_books
[
$address_book
->
getKey
()]);
}
...
...
This diff is collapsed.
Click to expand it.
tests/lib/public/contacts.php
+
4
−
4
View file @
a4d3cc79
...
...
@@ -39,7 +39,7 @@ class Test_Contacts extends PHPUnit_Framework_TestCase
public
function
testEnabledAfterRegister
()
{
// create mock for the addressbook
$stub
=
$this
->
getMock
(
"Simple
AddressBook"
,
array
(
'getKey'
));
$stub
=
$this
->
getMock
ForAbstractClass
(
"OCP\I
AddressBook"
,
array
(
'getKey'
));
// we expect getKey to be called twice:
// first time on register
...
...
@@ -65,7 +65,7 @@ class Test_Contacts extends PHPUnit_Framework_TestCase
public
function
testAddressBookEnumeration
()
{
// create mock for the addressbook
$stub
=
$this
->
getMock
(
"Simple
AddressBook"
,
array
(
'getKey'
,
'getDisplayName'
));
$stub
=
$this
->
getMock
ForAbstractClass
(
"OCP\I
AddressBook"
,
array
(
'getKey'
,
'getDisplayName'
));
// setup return for method calls
$stub
->
expects
(
$this
->
any
())
...
...
@@ -85,8 +85,8 @@ class Test_Contacts extends PHPUnit_Framework_TestCase
public
function
testSearchInAddressBook
()
{
// create mock for the addressbook
$stub1
=
$this
->
getMock
(
"Simple
AddressBook
1
"
,
array
(
'getKey'
,
'getDisplayName'
,
'search'
));
$stub2
=
$this
->
getMock
(
"Simple
AddressBook
2
"
,
array
(
'getKey'
,
'getDisplayName'
,
'search'
));
$stub1
=
$this
->
getMock
ForAbstractClass
(
"OCP\I
AddressBook"
,
array
(
'getKey'
,
'getDisplayName'
,
'search'
));
$stub2
=
$this
->
getMock
ForAbstractClass
(
"OCP\I
AddressBook"
,
array
(
'getKey'
,
'getDisplayName'
,
'search'
));
$searchResult1
=
array
(
array
(
'id'
=>
0
,
'FN'
=>
'Frank Karlitschek'
,
'EMAIL'
=>
'a@b.c'
,
'GEO'
=>
'37.386013;-122.082932'
),
...
...
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