public function setUp()
 {
     //$this->parseObject = new parseObject('test');
     $this->parseObject = \Enhance\Core::getCodeCoverageWrapper('parseObject', array('test'));
     $this->testfield1 = 'test1';
     $this->testfield2 = 'test2';
 }
 public function sendWithDataExpectTrue()
 {
     $AVPush = \Enhance\Core::getCodeCoverageWrapper('AVPush');
     //$AVPush->channel = 'TEST_CHANNEL_ONE'; //this or channels required
     $AVPush->channels = array('TEST_CHANNEL_ONE', 'TEST_CHANNEL_TWO');
     //this or just channel required
     $AVPush->alert = 'Testing Channel 1';
     //required
     //BELOW SETTINGS ARE OPTIONAL, LOOKUP REST API DOCS HERE: http://AV.com/docs/rest#push FOR MORE INFO
     $AVPush->expiration_time = time(strtotime('+3 days'));
     //expire 3 day from now
     //$AVPush->expiration_time_interval = 86400; //expire in 24 hours from now
     $AVPush->type = 'ios';
     $AVPush->badge = 538;
     //ios only
     $AVPush->sound = 'cheer';
     //ios only
     $AVPush->content_available = 1;
     //ios only - for newsstand applications. Also, changed from content-available to content_available.
     //$AVPush->title = 'test notification title'; //android only - gives title to the notification
     //CUSTOM DATA CAN BE SENT VERY EASILY ALONG WITH YOUR NOTIFICATION MESSAGE AND CAN BE ACCESSED PROGRAMATICALLY VIA THE MOBILE DEVICE... JUST DON'T SET NAMES THE SAME AS RESERVERD ONES MENTIONED ABOVE
     $AVPush->customData = 'This data will be accessible in the ios and android SDK callback for push notifications';
     $return = $AVPush->send();
     \Enhance\Assert::isObject($return);
 }
 public function getJoinedStringWithTwoStringsExpectJoinedResult()
 {
     /** @var ExampleAnotherClass $target */
     $target = \Enhance\Core::getCodeCoverageWrapper('\\FirstTest\\ExampleAnotherClass', array('xx', 'yy'));
     $result = $target->getJoinedString('A', 'B');
     \Enhance\Assert::areIdentical('ABxx', $result);
 }
 public function useCodeCoverageLoggerToSetProperty()
 {
     /** @var TestClassForCodeCoverageLogger $target */
     $target = \Enhance\Core::getCodeCoverageWrapper('TestClassForCodeCoverageLogger');
     $target->property = 8;
     $result = $target->property;
     \Enhance\Assert::areIdentical(8, $result);
 }
 public function addTwoNumbersWith3and2Expect5Test()
 {
     // Arrange
     $target = \Enhance\Core::getCodeCoverageWrapper('ExampleClass');
     // Act
     $result = $target->addTwoNumbers(3, 2);
     // Assert
     \Enhance\Assert::areIdentical(5, $result);
 }
 public function scenarioTestWithMismatchWithAndExpectExpectException()
 {
     $target = \Enhance\Core::getCodeCoverageWrapper('ScenarioExampleClass');
     $scenario = \Enhance\Core::getScenario($target, 'addTwoNumbers');
     $scenario->with(1, 2);
     // missing the expectation, this is the point of this test
     $scenario->with(1, 2)->expect(5);
     try {
         $scenario->VerifyExpectations();
     } catch (exception $e) {
         \Enhance\Assert::AreIdentical('Scenario must be initialised with the same number of "with" and "expect" calls', $e->getMessage());
     }
 }
 public function setUp()
 {
     //setup test data to query
     $parseObject = new parseObject('test');
     $parseObject->score = 1111;
     $parseObject->name = 'Foo';
     $parseObject->mode = 'cheat';
     $this->parseObject = $parseObject->save();
     $parseObject2 = new parseObject('test');
     $parseObject2->score = 2222;
     $parseObject2->name = 'Bar';
     $parseObject2->mode = 'nocheat';
     $parseObject2->phone = '555-555-1234';
     $parseObject2->object1 = $parseObject2->dataType('pointer', array('test', $this->parseObject->objectId));
     $this->parseObject2 = $parseObject2->save();
     $this->parseQuery = \Enhance\Core::getCodeCoverageWrapper('parseQuery', array('test'));
     $this->parseQueryUser = \Enhance\Core::getCodeCoverageWrapper('parseQuery', array('users'));
 }
 public function setUp()
 {
     $this->target = \Enhance\Core::getCodeCoverageWrapper('\\Enhance\\Assertions', array(\Enhance\Language::English));
 }
Exemple #9
0
<?php

// Include the test framework
include '../EnhanceTestFramework.php';
// Find the tests - '.' is the current folder
\Enhance\Core::discoverTests('.', true, array('Exclusion'));
// Run the tests
\Enhance\Core::runTests();
?>

 public function setUp()
 {
     $confobj = Config::get_instance();
     $this->target = \Enhance\Core::getCodeCoverageWrapper('enhancedcalc', array($confobj));
 }
 public function setUp()
 {
     $this->target = \Enhance\Core::getCodeCoverageWrapper('CodespyTest\\ExampleClass');
 }
 public function getGeoPointExpectType()
 {
     $return = \Enhance\Core::getCodeCoverageWrapper('parseGeoPoint', array(40.0, -30.0));
     \Enhance\Assert::isTrue(array_key_exists('__type', $return->location));
 }
Exemple #13
0
 public function setUp()
 {
     $this->target = \Enhance\Core::getCodeCoverageWrapper('EnhancedCalc_phpEval', array(array()));
 }
 public function saveExpectName()
 {
     $return = \Enhance\Core::getCodeCoverageWrapper('parseFile', array('text/plain', 'Working at Parse is great!'));
     $save = $return->save('hello.txt');
     \Enhance\Assert::isTrue(property_exists($save, 'name'));
 }
Exemple #15
0
 public function setUp()
 {
     $enhancedcalculation = array('host' => 'suivarro.nottingham.ac.uk', 'port' => 6311, 'timeout' => 5);
     $this->target = \Enhance\Core::getCodeCoverageWrapper('EnhancedCalc_Rrserve', array($enhancedcalculation));
 }
 public function setUp()
 {
     $this->target = \Enhance\Core::getCodeCoverageWrapper('\\Kata\\StringCalculator');
 }