Skip to content

Commit 70eef2a

Browse files
committed
Initial test setup (PhpUnit)
1 parent ad87017 commit 70eef2a

30 files changed

+531
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vendor

composer.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
"PHPShopify\\": "lib/"
2121
}
2222
},
23-
"minimum-stability": "dev",
24-
"prefer-stable": true
23+
"autoload-dev": {
24+
"psr-4": {"PHPShopify\\": "tests/"}
25+
},
26+
"require-dev": {
27+
"phpunit/phpunit": "^5.5"
28+
}
2529
}

phpunit.xml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<phpunit bootstrap="vendor/autoload.php" colors="true">
4+
<testsuites>
5+
<testsuite name="PHPShopify Test Suite">
6+
<directory>./tests/</directory>
7+
</testsuite>
8+
</testsuites>
9+
10+
<filter>
11+
<whitelist>
12+
<directory suffix=".php">lib/</directory>
13+
</whitelist>
14+
</filter>
15+
16+
<php>
17+
<ini name="date.timezone" value="UTC"/>
18+
</php>
19+
</phpunit>

tests/AbandonedCheckoutTest.php

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/9/16 7:41 PM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class AbandonedCheckoutTest extends TestSimpleResource
12+
{
13+
}

tests/ApplicationChargeTest.php

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/9/16 9:59 PM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class ApplicationChargeTest extends TestSimpleResource
12+
{
13+
}

tests/BlogTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:43 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class BlogTest extends TestSimpleResource
12+
{
13+
14+
}

tests/CarrierServiceTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:44 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class CarrierServiceTest extends TestSimpleResource
12+
{
13+
14+
}

tests/CollectTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:44 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class CollectTest extends TestSimpleResource
12+
{
13+
14+
}

tests/CommentTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:45 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class CommentTest extends TestSimpleResource
12+
{
13+
14+
}

tests/CountryTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:45 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class CountryTest extends TestSimpleResource
12+
{
13+
14+
}

tests/CustomCollectionTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:45 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class CustomCollectionTest extends TestSimpleResource
12+
{
13+
14+
}

tests/CustomerSavedSearchTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:46 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class CustomerSavedSearchTest extends TestSimpleResource
12+
{
13+
14+
}

tests/CustomerTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:45 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class CustomerTest extends TestSimpleResource
12+
{
13+
14+
}

tests/FulfillmentServiceTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:47 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class FulfillmentServiceTest extends TestSimpleResource
12+
{
13+
14+
}

tests/LocationTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:48 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class LocationTest extends TestSimpleResource
12+
{
13+
14+
}

tests/MetafieldTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:48 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class MetafieldTest extends TestSimpleResource
12+
{
13+
14+
}

tests/OrderTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:48 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class OrderTest extends TestSimpleResource
12+
{
13+
14+
}

tests/PageTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:49 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class PageTest extends TestSimpleResource
12+
{
13+
14+
}

tests/PolicyTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:49 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class PolicyTest extends TestSimpleResource
12+
{
13+
14+
}

tests/ProductTest.php

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/9/16 12:44 PM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class ProductTest extends TestSimpleResource
12+
{
13+
public $postArray = array(
14+
"title" => "Burton Custom Freestlye 151",
15+
"body_html" => "<strong>Good snowboard!</strong>",
16+
"vendor" => "Burton",
17+
"product_type" => "Snowboard",
18+
"variants" => [
19+
[
20+
"option1" => "First",
21+
"price" => "10.00",
22+
"sku" => 123
23+
],
24+
[
25+
"option1" => "Second",
26+
"price" => "20.00",
27+
"sku" => "123"
28+
]
29+
]
30+
);
31+
32+
//Posting without title, triggers an error
33+
public $errorPostArray = array("description" => "A mystery!");
34+
35+
public $putArray = array("title" => "New product title");
36+
}
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:49 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class RecurringApplicationChargeTest extends TestSimpleResource
12+
{
13+
14+
}

tests/RedirectTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:49 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class RedirectTest extends TestSimpleResource
12+
{
13+
14+
}

tests/ScriptTagTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:50 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class ScriptTagTest extends TestSimpleResource
12+
{
13+
14+
}

tests/ShippingZoneTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* @author Tareq Mahmood <[email protected]>
5+
* Created at: 9/10/16 10:50 AM UTC+06:00
6+
*/
7+
8+
namespace PHPShopify;
9+
10+
11+
class ShippingZoneTest extends TestSimpleResource
12+
{
13+
14+
}

0 commit comments

Comments
 (0)