-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from Jack-Dane/#35_fix_create_record_button_ui
#35 fix create record button UI
- Loading branch information
Showing
12 changed files
with
120 additions
and
61 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
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,21 @@ | ||
<?php | ||
|
||
namespace end_to_end_tests\tests\endpoint_tests; | ||
|
||
require_once __DIR__ . '/EndpointTestBase.php'; | ||
|
||
|
||
class CF7_Test extends EndpointTestBase | ||
{ | ||
|
||
protected function endpoint() | ||
{ | ||
return 'http://localhost:8000/?rest_route=/odoo_conn/v1/get-contact-7-forms'; | ||
} | ||
|
||
public function test() | ||
{ | ||
$this->make_request(); | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
tests/end_to_end_tests/tests/endpoint_tests/EndpointTestBase.php
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,36 @@ | ||
<?php | ||
|
||
namespace end_to_end_tests\tests\endpoint_tests; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use GuzzleHttp\Client; | ||
use GuzzleHttp\Exception\ClientException; | ||
|
||
|
||
abstract class EndpointTestBase extends Testcase { | ||
|
||
public function setUp(): void | ||
{ | ||
$this->client = new Client(); | ||
} | ||
|
||
protected abstract function endpoint(); | ||
|
||
protected function make_request() | ||
{ | ||
$failure = false; | ||
try { | ||
$this->client->request( | ||
'GET', $this->endpoint() | ||
); | ||
} catch (ClientException $e) { | ||
$failure = true; | ||
$this->assertEquals(401, $e->getResponse()->getStatusCode()); | ||
} | ||
$this->assertTrue($failure); | ||
} | ||
|
||
} | ||
|
||
|
||
?> |
34 changes: 12 additions & 22 deletions
34
tests/end_to_end_tests/tests/endpoint_tests/OdooConnection_Test.php
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 |
---|---|---|
@@ -1,31 +1,21 @@ | ||
<?php | ||
|
||
use \PHPUnit\Framework\TestCase; | ||
use \GuzzleHttp\Client; | ||
use \GuzzleHttp\Exception\ClientException; | ||
namespace end_to_end_tests\tests\endpoint_tests; | ||
|
||
class OdooConnection_Test extends TestCase | ||
{ | ||
require_once __DIR__ . '/EndpointTestBase.php'; | ||
|
||
public function setUp(): void | ||
{ | ||
$this->client = new Client(); | ||
} | ||
class OdooConnection_Test extends EndpointTestBase | ||
{ | ||
|
||
public function test_get_odoo_connections() | ||
{ | ||
$failure = false; | ||
try { | ||
$response = $this->client->request( | ||
"GET", "http://localhost:8000/?rest_route=/odoo_conn/v1/get-odoo-connections" | ||
); | ||
} catch (ClientException $e) { | ||
$failure = true; | ||
$this->assertEquals(401, $e->getResponse()->getStatusCode()); | ||
} | ||
$this->assertTrue($failure); | ||
} | ||
protected function endpoint() | ||
{ | ||
return 'http://localhost:8000/?rest_route=/odoo_conn/v1/get-odoo-connections'; | ||
} | ||
|
||
public function test() | ||
{ | ||
$this->make_request(); | ||
} | ||
} | ||
|
||
?> |
33 changes: 12 additions & 21 deletions
33
tests/end_to_end_tests/tests/endpoint_tests/OdooForm_Test.php
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