Skip to content

Commit 253f570

Browse files
committed
Fix tests and fixtures
1 parent 0824f64 commit 253f570

File tree

7 files changed

+18
-17
lines changed

7 files changed

+18
-17
lines changed

tests/bootstrap.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
define('CLI_ROOT', dirname(__DIR__) );
66
define('TERMINUS_CMD','php '.CLI_ROOT.'/php/boot-fs.php');
77
putenv("CLI_TEST_MODE=1");
8-
//putenv("BUILD_FIXTURES=1");
8+
putenv("BUILD_FIXTURES=0");
9+
putenv("USE_FIXTURES=1");
910
require_once CLI_ROOT.'/php/boot-fs.php';
1011
use Terminus\Fixtures;
1112
use Terminus\Session;
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
s:378:"POST /api/sites/cf4301c9-9a3c-43a9-b281-d9961401083e/environments/dev/backups/catalog/1415309739_backup/database/s3token HTTP/1.1
2-
Host: onebox
1+
s:289:"GET /api/sites/4ff603ab-57cd-4b66-aebd-781a58e3b3fd/environments HTTP/1.1
2+
Host: dashboard.getpantheon.com
33
User-Agent: Guzzle/3.8.0 curl/7.35.0 PHP/5.5.9-1ubuntu4.4
4-
Content-Length: 16
5-
Cookie: X-Pantheon-Session=77629472-3050-457c-8c3d-32b2cabf992b:3ad21bbe-6609-11e4-a014-bc764e100eb1:U00eIlAZM2FzyUlGd92Yn
6-
Content-type: application/json";
4+
Cookie: X-Pantheon-Session=dca4f8cd-9ec2-4117-957f-fc5230c23737:7c468270-66e9-11e4-aa9b-bc764e111d20:eEFVhz2Dc87oZIJxqBtaM";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
C:28:"Guzzle\Http\Message\Response":1387:{{"status":200,"body":"{\"test\": {\"environment_created\": 1415402675, \"dns_zone\": \"pantheon.io\", \"randseed\": \"79NF16NJ66M3B9ZI8W7XFO61076DF4M5\", \"lock\": {\"username\": null, \"password\": null, \"locked\": false}, \"styx_cluster\": \"styx-01.pantheon.io\"}, \"dev\": {\"watchers\": 0, \"diffstat\": {}, \"on_server_development\": true, \"environment_created\": 1415402674, \"dns_zone\": \"pantheon.io\", \"randseed\": \"6OGE0HAB7TRD18BW4ABS5G7BVD7YVUHF\", \"target_ref\": \"refs\/heads\/master\", \"lock\": {\"username\": null, \"password\": null, \"locked\": false}, \"target_commit\": \"c2952a42b4babc7e24526bd16ff231f2c8e56d5c\", \"styx_cluster\": \"styx-01.pantheon.io\"}, \"live\": {\"environment_created\": 1415402676, \"dns_zone\": \"pantheon.io\", \"randseed\": \"BZRU2X93P53Y6GY4K1BMBJR76ZX1B0N9\", \"lock\": {\"username\": null, \"password\": null, \"locked\": false}, \"styx_cluster\": \"styx-01.pantheon.io\"}}","headers":{"Server":["nginx"],"Date":["Sat, 08 Nov 2014 01:51:55 GMT"],"Content-Type":["application\/json"],"Content-Length":["823"],"Connection":["keep-alive"],"X-Pantheon-Trace-Id":["fd8c062e-e8fb-4267-ac4c-6b147d71435f"],"X-Frame-Options":["deny"],"Access-Control-Allow-Origin":["https:\/\/dashboard.getpantheon.com"],"Access-Control-Allow-Methods":["GET"],"Access-Control-Allow-Headers":["Origin, Content-Type, Accept"],"Vary":["Accept-Encoding"]}}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
C:28:"Guzzle\Http\Message\Response":938:{{"status":200,"body":"{\"4ff603ab-57cd-4b66-aebd-781a58e3b3fd\": {\"information\": {\"service_level\": \"free\", \"name\": \"phpunittest\", \"created\": 1415402674, \"framework\": \"drupal\", \"upstream\": {\"url\": \"git:\/\/github.com\/pantheon-systems\/drops-7.git\", \"branch\": \"master\"}, \"owner\": \"dca4f8cd-9ec2-4117-957f-fc5230c23737\", \"last_code_push\": {\"timestamp\": \"2014-11-07T23:24:50\", \"user_uuid\": null}, \"preferred_zone\": \"chios\"}, \"metadata\": null}}","headers":{"Server":["nginx"],"Date":["Sat, 08 Nov 2014 01:51:55 GMT"],"Content-Type":["application\/json"],"Content-Length":["412"],"Connection":["keep-alive"],"X-Pantheon-Trace-Id":["4fe1962d-4327-4d19-b0e4-cc846e296cc7"],"X-Frame-Options":["deny"],"Access-Control-Allow-Origin":["https:\/\/dashboard.getpantheon.com"],"Access-Control-Allow-Methods":["GET"],"Access-Control-Allow-Headers":["Origin, Content-Type, Accept"],"Vary":["Accept-Encoding"]}}}

tests/test-session.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ class SessionTest extends PHPUnit_Framework_TestCase {
1010
public function testSession() {
1111
if (getenv("BUILD_FIXTURES") == 1) return true;
1212
$data = new stdClass();
13-
$data->session = 'alskdmca;sdlkcmas;dlc';
14-
$data->user_uuid = 'asdf;lkamsd';
15-
$data->session_expires_time = time(TRUE);
16-
$data->email = "test@email.com";
13+
$data->session = 'dca4f8cd-9ec2-4117-957f-fc5230c23737:7c468270-66e9-11e4-aa9b-bc764e111d20:eEFVhz2Dc87oZIJxqBtaM';
14+
$data->user_uuid = 'dca4f8cd-9ec2-4117-957f-fc5230c23737';
15+
$data->session_expires_time = 1417830572;
16+
$data->email = "mike+test@mikevanwinkle.com";
1717

1818
Session::instance()->setData($data);
1919
$session = Session::instance();

tests/test-site.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@
66
class SiteTest extends PHPUnit_Framework_TestCase {
77

88
function testGetId() {
9-
$site = SiteFactory::instance('behat-test');
9+
$site = SiteFactory::instance('phpunittest');
1010
$this->assertObjectHasAttribute("id",$site);
1111
$this->assertNotNull($site->getId());
1212
$this->assertStringMatchesFormat("%a-%a-%a-%a",$site->getId());
1313
}
1414

1515
function testGetName() {
16-
$site = SiteFactory::instance('behat-test');
16+
$site = SiteFactory::instance('phpunittest');
1717
$this->assertObjectHasAttribute("name",$site->information);
1818
$this->assertNotNull($site->getName());
1919
$this->assertStringMatchesFormat("%a",$site->getName());
20-
$this->assertEquals('behat-test',$site->getName());
20+
$this->assertEquals('phpunittest',$site->getName());
2121
}
2222

2323
function testEnvironments() {
24-
$site = SiteFactory::instance('behat-test');
24+
$site = SiteFactory::instance('phpunittest');
2525
$environments = $site->environments();
2626
$this->assertInstanceOf('\Terminus\EnvironmentDev', $environments->dev);
2727
$this->assertInstanceOf('\Terminus\EnvironmentTest', $environments->test);
2828
$this->assertInstanceOf('\Terminus\EnvironmentLive', $environments->live);
2929
}
3030

3131
function testInfo() {
32-
$site = SiteFactory::instance('behat-test');
32+
$site = SiteFactory::instance('phpunittest');
3333
$data = $site->info();
3434
$this->assertNotEmpty($data);
3535
$this->assertInstanceOf('stdClass', $data);

tests/test-sitefactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ function testInstance() {
1313
$sites = SiteFactory::instance();
1414
$this->assertTrue(is_array($sites));
1515
$this->assertNotEmpty($sites);
16-
$this->assertArrayHasKey('behat-test', $sites);
16+
$this->assertArrayHasKey('phpunittest', $sites);
1717
unset($sites);
1818

19-
$site = SiteFactory::instance('behat-test');
19+
$site = SiteFactory::instance('phpunittest');
2020
$this->assertInstanceOf('\Terminus\Site',$site);
2121
$this->assertObjectHasAttribute("id",$site);
2222
$this->assertObjectHasAttribute("information",$site);

0 commit comments

Comments
 (0)