Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
f22d409e
Commit
f22d409e
authored
Mar 02, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test break fix.
parent
48a12559
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
rest.md
docs/guide/rest.md
+19
-1
ModelTest.php
tests/unit/framework/base/ModelTest.php
+1
-1
No files found.
docs/guide/rest.md
View file @
f22d409e
...
...
@@ -86,7 +86,25 @@ for accessing the user data. The APIs you have created include:
You may access your APIs with the
`curl`
command like the following,
```
curl -i -u "Your-API-Key:" -H "Accept:application/json" -d "_method=GET" "http://localhost/users"
curl -i -u "Your-API-Key:" -H "Accept:application/json" "http://localhost/users"
```
which may give the following output:
```
HTTP/1.1 200 OK
Date: Sun, 02 Mar 2014 05:31:43 GMT
Server: Apache/2.2.26 (Unix) DAV/2 PHP/5.4.20 mod_ssl/2.2.26 OpenSSL/0.9.8y
X-Powered-By: PHP/5.4.20
X-Pagination-Total-Count: 1000
X-Pagination-Page-Count: 50
X-Pagination-Current-Page: 1
X-Pagination-Per-Page: 20
Link: <http://localhost/users?page=1>; rel=self, <http://localhost/users?page=2>; rel=next, <http://localhost/users?page=50>; rel=last
Transfer-Encoding: chunked
Content-Type: application/json; charset=UTF-8
[{"id":1,..},{"id":2,...}...]
```
> Tip: You may also access your API via Web browser. You will be asked
...
...
tests/unit/framework/base/ModelTest.php
View file @
f22d409e
...
...
@@ -147,7 +147,7 @@ class ModelTest extends TestCase
$this
->
assertTrue
(
$speaker
->
hasErrors
(
'firstName'
));
$this
->
assertFalse
(
$speaker
->
hasErrors
(
'lastName'
));
$this
->
assertEquals
([
'Something is wrong!'
],
$speaker
->
getFirstErrors
());
$this
->
assertEquals
([
'
firstName'
=>
'
Something is wrong!'
],
$speaker
->
getFirstErrors
());
$this
->
assertEquals
(
'Something is wrong!'
,
$speaker
->
getFirstError
(
'firstName'
));
$this
->
assertNull
(
$speaker
->
getFirstError
(
'lastName'
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment