Browse Source

Fix typos

Feram 8 years ago
parent
commit
11fa7c8c97
7 changed files with 12 additions and 12 deletions
  1. 3
    3
      README.md
  2. 1
    1
      extras/core.php
  3. 1
    1
      tests/blog_mysql.sql
  4. 1
    1
      tests/blog_postgresql.sql
  5. 1
    1
      tests/blog_sqlite.sql
  6. 1
    1
      tests/blog_sqlserver.sql
  7. 4
    4
      tests/tests.php

+ 3
- 3
README.md View File

@@ -150,8 +150,8 @@ Search is implemented with the "filter" parameter. You need to specify the colum
150 150
   - le: lower or equal (number is lower than or equal to value)
151 151
   - ge: greater or equal (number is higher than or equal to value)
152 152
   - gt: greater than (number is higher than value)
153
-  - in: in (number is in comma seperated list of values)
154
-  - ni: not in (number is not in comma seperated list of values)
153
+  - in: in (number is in comma separated list of values)
154
+  - ni: not in (number is not in comma separated list of values)
155 155
   - is: is null (field contains "NULL" value)
156 156
   - no: not null (field does not contain "NULL" value)
157 157
 
@@ -186,7 +186,7 @@ Output:
186 186
 
187 187
 ### List + Column selection
188 188
 
189
-By default all columns are selected. With the "columns" parameter you can select specific columns. Multiple columns should be comma seperated. An asterisk ("*") may be used as a wildcard to indicate "all columns":
189
+By default all columns are selected. With the "columns" parameter you can select specific columns. Multiple columns should be comma separated. An asterisk ("*") may be used as a wildcard to indicate "all columns":
190 190
 
191 191
 ```
192 192
 GET http://localhost/api.php/categories?columns=name

+ 1
- 1
extras/core.php View File

@@ -39,7 +39,7 @@ switch ($method) {
39 39
     $sql = "delete `$table` where id=$key"; break;
40 40
 }
41 41
  
42
-// excecute SQL statement
42
+// execute SQL statement
43 43
 $result = mysqli_query($link,$sql);
44 44
  
45 45
 // die if SQL statement failed

+ 1
- 1
tests/blog_mysql.sql View File

@@ -14,7 +14,7 @@ CREATE TABLE `categories` (
14 14
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
15 15
 
16 16
 INSERT INTO `categories` (`id`, `name`, `icon`) VALUES
17
-(1,	'anouncement',	NULL),
17
+(1,	'announcement',	NULL),
18 18
 (2,	'article',	NULL);
19 19
 
20 20
 DROP TABLE IF EXISTS `comments`;

+ 1
- 1
tests/blog_postgresql.sql View File

@@ -97,7 +97,7 @@ CREATE TABLE users (
97 97
 --
98 98
 
99 99
 INSERT INTO "categories" ("name", "icon") VALUES
100
-('anouncement',	NULL),
100
+('announcement',	NULL),
101 101
 ('article',	NULL);
102 102
 
103 103
 --

+ 1
- 1
tests/blog_sqlite.sql View File

@@ -7,7 +7,7 @@ CREATE TABLE "categories" (
7 7
   "icon" blob NULL
8 8
 );
9 9
 
10
-INSERT INTO "categories" ("id", "name", "icon") VALUES (1,	'anouncement',	NULL);
10
+INSERT INTO "categories" ("id", "name", "icon") VALUES (1,	'announcement',	NULL);
11 11
 INSERT INTO "categories" ("id", "name", "icon") VALUES (2,	'article',	NULL);
12 12
 
13 13
 DROP TABLE IF EXISTS "comments";

+ 1
- 1
tests/blog_sqlserver.sql View File

@@ -141,7 +141,7 @@ CREATE TABLE [users](
141 141
 GO
142 142
 SET IDENTITY_INSERT [categories] ON
143 143
 GO
144
-INSERT [categories] ([id], [name], [icon]) VALUES (1, N'anouncement', NULL)
144
+INSERT [categories] ([id], [name], [icon]) VALUES (1, N'announcement', NULL)
145 145
 GO
146 146
 INSERT [categories] ([id], [name], [icon]) VALUES (2, N'article', NULL)
147 147
 GO

+ 4
- 4
tests/tests.php View File

@@ -329,14 +329,14 @@ class PHP_CRUD_API_Test extends PHPUnit_Framework_TestCase
329 329
 	{
330 330
 		$test = new API($this);
331 331
 		$test->get('/posts?include=categories,tags,comments&filter=id,eq,1');
332
-		$test->expect('{"posts":{"columns":["id","user_id","category_id","content"],"records":[["1","1","1","blog started"]]},"post_tags":{"relations":{"post_id":"posts.id"},"columns":["id","post_id","tag_id"],"records":[["1","1","1"],["2","1","2"]]},"categories":{"relations":{"id":"posts.category_id"},"columns":["id","name","icon"],"records":[["1","anouncement",null]]},"tags":{"relations":{"id":"post_tags.tag_id"},"columns":["id","name"],"records":[["1","funny"],["2","important"]]},"comments":{"relations":{"post_id":"posts.id"},"columns":["id","post_id","message"],"records":[["1","1","great"],["2","1","fantastic"]]}}');
332
+		$test->expect('{"posts":{"columns":["id","user_id","category_id","content"],"records":[["1","1","1","blog started"]]},"post_tags":{"relations":{"post_id":"posts.id"},"columns":["id","post_id","tag_id"],"records":[["1","1","1"],["2","1","2"]]},"categories":{"relations":{"id":"posts.category_id"},"columns":["id","name","icon"],"records":[["1","announcement",null]]},"tags":{"relations":{"id":"post_tags.tag_id"},"columns":["id","name"],"records":[["1","funny"],["2","important"]]},"comments":{"relations":{"post_id":"posts.id"},"columns":["id","post_id","message"],"records":[["1","1","great"],["2","1","fantastic"]]}}');
333 333
 	}
334 334
 
335 335
 	public function testListExampleFromReadmeWithTransform()
336 336
 	{
337 337
 		$test = new API($this);
338 338
 		$test->get('/posts?include=categories,tags,comments&filter=id,eq,1&transform=1');
339
-		$test->expect('{"posts":[{"id":"1","post_tags":[{"id":"1","post_id":"1","tag_id":"1","tags":[{"id":"1","name":"funny"}]},{"id":"2","post_id":"1","tag_id":"2","tags":[{"id":"2","name":"important"}]}],"comments":[{"id":"1","post_id":"1","message":"great"},{"id":"2","post_id":"1","message":"fantastic"}],"user_id":"1","category_id":"1","categories":[{"id":"1","name":"anouncement","icon":null}],"content":"blog started"}]}');
339
+		$test->expect('{"posts":[{"id":"1","post_tags":[{"id":"1","post_id":"1","tag_id":"1","tags":[{"id":"1","name":"funny"}]},{"id":"2","post_id":"1","tag_id":"2","tags":[{"id":"2","name":"important"}]}],"comments":[{"id":"1","post_id":"1","message":"great"},{"id":"2","post_id":"1","message":"fantastic"}],"user_id":"1","category_id":"1","categories":[{"id":"1","name":"announcement","icon":null}],"content":"blog started"}]}');
340 340
 	}
341 341
 
342 342
 	public function testEditCategoryWithBinaryContent()
@@ -487,7 +487,7 @@ class PHP_CRUD_API_Test extends PHPUnit_Framework_TestCase
487 487
 	{
488 488
 		$test = new API($this);
489 489
 		$test->get('/categories?filter[]=icon,is,null&transform=1');
490
-		$test->expect('{"categories":[{"id":"1","name":"anouncement","icon":null},{"id":"2","name":"alert();","icon":null}]}');
490
+		$test->expect('{"categories":[{"id":"1","name":"announcement","icon":null},{"id":"2","name":"alert();","icon":null}]}');
491 491
 	}
492 492
 
493 493
 	public function testFilterCategoryOnNotNullIcon()
@@ -522,7 +522,7 @@ class PHP_CRUD_API_Test extends PHPUnit_Framework_TestCase
522 522
 	{
523 523
 		$test = new API($this);
524 524
 		$test->get('/posts?include=categories&columns=categories.name&filter=id,eq,1&transform=1');
525
-		$test->expect('{"posts":[{"category_id":"1","categories":[{"id":"1","name":"anouncement"}]}]}');
525
+		$test->expect('{"posts":[{"category_id":"1","categories":[{"id":"1","name":"announcement"}]}]}');
526 526
 	}
527 527
 
528 528
 	public function testColumnsOnWrongInclude()

Loading…
Cancel
Save