This repository has been archived by the owner on Sep 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
94 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
class ActivationTest extends PHPUnit_Framework_TestCase { | ||
|
||
protected $client; | ||
|
||
public function setUp() { | ||
$this->client = new GuzzleHttp\Client([ | ||
'defaults' => ['exceptions' => false], | ||
]); | ||
} | ||
|
||
public function test_load() { | ||
$response = $this->client->get( wc_pos_url(), [ | ||
'allow_redirects' => false | ||
]); | ||
// expect 302 redirect to login | ||
$this->assertEquals(302, $response->getStatusCode()); | ||
} | ||
|
||
public function test_load_order() { | ||
// reverse plugin load order | ||
update_option('active_plugins', array( | ||
'woocommerce/woocommerce.php', | ||
'woocommerce-pos/woocommerce-pos.php' | ||
)); | ||
|
||
$response = $this->client->get( wc_pos_url(), [ | ||
'allow_redirects' => false | ||
]); | ||
// expect 302 redirect to login | ||
$this->assertEquals(302, $response->getStatusCode()); | ||
|
||
// restore plugin load order | ||
update_option('active_plugins', array( | ||
'woocommerce-pos/woocommerce-pos.php', | ||
'woocommerce/woocommerce.php' | ||
)); | ||
} | ||
|
||
public function tearDown(){ | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters