-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make file process abstraction more sensible #2766
- Loading branch information
Josh Pollock
committed
Oct 25, 2018
1 parent
8fbf3f8
commit d215155
Showing
7 changed files
with
104 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
|
||
namespace calderawp\calderaforms\Tests\Integration\Transients; | ||
|
||
use calderawp\calderaforms\cf2\Transients\Cf1TransientsApi; | ||
use calderawp\calderaforms\Tests\Integration\TestCase; | ||
|
||
class Cf1TransientsApiTest extends TestCase | ||
{ | ||
|
||
/** | ||
* Test that new Transients API wrapper is interoperable with old API's delete method | ||
* | ||
* @since 1.8.0 | ||
* | ||
* @group transients | ||
* | ||
* @covers \calderawp\calderaforms\cf2\Transients\Cf1TransientsApi::deleteTransient() | ||
*/ | ||
public function testDeleteTransient() | ||
{ | ||
|
||
$id = rand() . '1'; | ||
$data = [ | ||
'foo' => 'barts' | ||
]; | ||
\Caldera_Forms_Transient::set_transient($id, $data, 699 ); | ||
$api = new Cf1TransientsApi(); | ||
$api->deleteTransient($id); | ||
$this->assertFalse( $api->getTransient($id) ); | ||
} | ||
|
||
/** | ||
* Test that new Transients API wrapper is interoperable with old API's set method | ||
* | ||
* @since 1.8.0 | ||
* | ||
* @group transients | ||
* | ||
* @covers \calderawp\calderaforms\cf2\Transients\Cf1TransientsApi::getTransient() | ||
*/ | ||
public function testGetTransient() | ||
{ | ||
$id = rand() . '2'; | ||
$data = [ | ||
'foo' => 'barts' | ||
]; | ||
\Caldera_Forms_Transient::set_transient($id, $data, 699 ); | ||
$api = new Cf1TransientsApi(); | ||
$this->assertEquals( $data, $api->getTransient($id) ); | ||
} | ||
|
||
/** | ||
* Test that new Transients API wrapper is interoperable with old API's get method | ||
* | ||
* @since 1.8.0 | ||
* | ||
* @group transients | ||
* | ||
* @covers \calderawp\calderaforms\cf2\Transients\Cf1TransientsApi::setTransient() | ||
*/ | ||
public function testSetTransient() | ||
{ | ||
$id = rand() . '3'; | ||
$data = [ | ||
'foo' => 'barts' | ||
]; | ||
$api = new Cf1TransientsApi(); | ||
$api->setTransient($id, $data, 699); | ||
$this->assertEquals( $data, \Caldera_Forms_Transient::get_transient ($id) ); | ||
} | ||
|
||
} |
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