Exemplo n.º 1
0
 public static function check(\PHPUnit_Framework_TestCase $test, $name, $display, $url, Organization $organization = null)
 {
     $test->assertNotNull($organization);
     $test->assertEquals($name, $organization->getOrganizationName());
     $test->assertEquals($display, $organization->getOrganizationDisplayName());
     $test->assertEquals($url, $organization->getOrganizationURL());
 }
Exemplo n.º 2
0
 public static function checkCertificateCN(\PHPUnit_Framework_TestCase $test, $use, $cn, KeyDescriptor $kd = null)
 {
     $test->assertNotNull($kd);
     $test->assertEquals($use, $kd->getUse());
     $test->assertNotEmpty($kd->getCertificate()->getData());
     $crt = openssl_x509_parse($kd->getCertificate()->toPem());
     $test->assertEquals($cn, $crt['subject']['CN']);
 }
Exemplo n.º 3
0
 public function assert()
 {
     $title = $this->webDriver->getTitle();
     \PHPUnit_Framework_TestCase::assertNotNull($title);
     \PHPUnit_Framework_TestCase::assertNotNull($this->title);
     $title = trim($title);
     \PHPUnit_Framework_TestCase::assertEquals($title, $this->title);
 }
Exemplo n.º 4
0
 public static function check(\PHPUnit_Framework_TestCase $test, $type, $company, $givenName, $surName, $email, $phone, ContactPerson $contact = null)
 {
     $test->assertNotNull($contact);
     $test->assertEquals($type, $contact->getContactType());
     $test->assertEquals($company, $contact->getCompany());
     $test->assertEquals($givenName, $contact->getGivenName());
     $test->assertEquals($surName, $contact->getSurName());
     $test->assertEquals($email, $contact->getEmailAddress());
     $test->assertEquals($phone, $contact->getTelephoneNumber());
 }
Exemplo n.º 5
0
 public function assert()
 {
     $title = $this->webDriver->getTitle();
     \PHPUnit_Framework_TestCase::assertNotNull($title);
     \PHPUnit_Framework_TestCase::assertNotNull($this->title);
     $title = trim($title);
     $pos = strpos($title, $this->title);
     \PHPUnit_Framework_TestCase::assertNotFalse($pos);
     $testEquals = $pos + strlen($this->title);
     $browserEquals = strlen($title);
     \PHPUnit_Framework_TestCase::assertEquals($testEquals, $browserEquals);
 }
Exemplo n.º 6
0
 public static function check(\PHPUnit_Framework_TestCase $test, $binding, $location, Endpoint $svc = null)
 {
     $test->assertNotNull($svc);
     $test->assertEquals($binding, $svc->getBinding());
     $test->assertEquals($location, $svc->getLocation());
 }
Exemplo n.º 7
0
 /**
  * @Then I can see all the associated data for RND17 Schools ESU strip in the EP database with valid field values
  */
 public function iCanSeeAllTheAssociatedDataForRndEsuStripInTheEpDatabaseWithValidFieldValues()
 {
     $db = new EpDbConnectionAndDataExtraction();
     //echo TestData::$formData['esu_widget_email'];
     $db->dbEmailSubscribes(TestData::$formData['esu_strip_email'], $this->testData->dbServerTest);
     if (!EpMessageQueueAccess::$jsonMQString['timestamp'] == null && strcmp(EpMessageQueueAccess::$jsonMQString['email'], TestData::$formData['esu_strip_email']) == 0 && strcmp(EpMessageQueueAccess::$jsonMQString['campaign'], 'RND17') == 0) {
         PHPUnit_Framework_TestCase::assertEquals(EpMessageQueueAccess::$jsonMQString['timestamp'], $db->dbData['Timestamp'], "Failed:Actual and expected Timestamp is not equal in EP DB, Plz check manually ");
     } else {
         echo "Messages are consumed before looking into MessageQueue-DatabaseTimestamp:" . $db->dbData['Timestamp'];
     }
     PHPUnit_Framework_TestCase::assertNotNull($db->dbData['Timestamp'], "Failed: Timestamp is null: Plz check manually");
     PHPUnit_Framework_TestCase::assertEquals(TestData::$formData['esu_strip_email'], $db->dbData['EmailAddress'], 'Failed:Actual and expected Email is not equal in EP DB, plz check maually in the DB');
     PHPUnit_Framework_TestCase::assertTrue(strpos($db->dbData['TransSourceURL'], '/node/1') !== false, 'Failed: Correct transsource URL was not displayed in EP DB, plz check maually in the MQ');
     PHPUnit_Framework_TestCase::assertEquals('esu', $db->dbData['TransType'], 'Failed:Actual and expected trasType is not equal in EP DB, plz check maually in the DB');
     PHPUnit_Framework_TestCase::assertEquals('RND17', $db->dbData['Campaign'], 'Failed:Actual and expected Campaign is not equal in EP DB, plz check maually in the DB');
     if (strcmp(TestData::$device, 'Desktop') == 0) {
         PHPUnit_Framework_TestCase::assertEquals($this->testData->RND17DesktopSchoolsESUStripTransSource, $db->dbData['TransSource'], 'Failed:Actual and expected desktop transSource is not equal in EP Queue, plz check maually in the MQ');
     } else {
         if (strcmp(TestData::$device, 'Mobile') == 0) {
             PHPUnit_Framework_TestCase::assertEquals($this->testData->RND17MobileSchoolsESUStripTransSource, $db->dbData['TransSource'], 'Failed:Actual and expected mobile transSource is not equal in EP Queue, plz check maually in the MQ');
         }
     }
     if (!empty(TestData::$formData['SchoolsAgeGroup'])) {
         PHPUnit_Framework_TestCase::assertEquals('teacher', $db->dbData['TeacherList'], "Failed: Expected Teacher List value is not found in db: Plz check manually");
         if (TestData::$formData['SchoolsAgeGroup'] == 'Early Years or Nursery') {
             PHPUnit_Framework_TestCase::assertEquals('EY', $db->dbData['SchoolPhase'], "Failed: Expected SchoolPhase value for Early years not found in db: Plz check manually");
         } else {
             if (TestData::$formData['SchoolsAgeGroup'] == 'Primary') {
                 PHPUnit_Framework_TestCase::assertEquals('PY', $db->dbData['SchoolPhase'], "Failed: Expected SchoolPhase value for Primary not found in db: Plz check manually");
             } else {
                 if (TestData::$formData['SchoolsAgeGroup'] == 'Secondary') {
                     PHPUnit_Framework_TestCase::assertEquals('SY', $db->dbData['SchoolPhase'], "Failed: Expected SchoolPhase value for Secondary  not found in db: Plz check manually");
                 } else {
                     if (TestData::$formData['SchoolsAgeGroup'] == 'Further Education or Sixth-Form College') {
                         PHPUnit_Framework_TestCase::assertEquals('FE', $db->dbData['SchoolPhase'], "Failed: Expected SchoolPhase value for Further Education not found in db: Plz check manually");
                     } else {
                         if (TestData::$formData['SchoolsAgeGroup'] == 'Higher Education') {
                             PHPUnit_Framework_TestCase::assertEquals('HE', $db->dbData['SchoolPhase'], "Failed: Expected SchoolPhase value for Higher Education not found in db: Plz check manually");
                         } else {
                             if (TestData::$formData['SchoolsAgeGroup'] == 'Other') {
                                 PHPUnit_Framework_TestCase::assertEquals('other', $db->dbData['SchoolPhase'], "Failed: Expected SchoolPhase value for Other not found in db: Plz check manually");
                             }
                         }
                     }
                 }
             }
         }
     }
     if (empty(TestData::$formData['SchoolsAgeGroup'])) {
         PHPUnit_Framework_TestCase::assertEquals('general', $db->dbData['GeneralList'], "Failed: Expected General List value is not found in db: Plz check manually");
     }
 }
 /**
  * @param \PHPUnit_Framework_TestCase $test
  * @param TokenRestrictionTemplate    $expected
  * @param TokenRestrictionTemplate    $actual
  */
 public static function assertEqualsTokenRestrictionTemplate($test, $expected, $actual)
 {
     // Assert
     $test->assertNotNull($expected);
     $test->assertNotNull($actual);
     $test->assertEquals($expected->getTokenType(), $actual->getTokenType());
     $test->assertEquals($expected->getAudience(), $actual->getAudience());
     $test->assertEquals($expected->getIssuer(), $actual->getIssuer());
     $test->assertEqualsVerificationKey($test, $expected->getPrimaryVerificationKey(), $actual->getPrimaryVerificationKey());
     $test->assertEquals(count($expected->getAlternateVerificationKeys()), count($actual->getAlternateVerificationKeys()));
     for ($i = 0; $i < count($expected->getAlternateVerificationKeys()); ++$i) {
         self::assertEqualsVerificationKey($test, $expected->getAlternateVerificationKeys()[$i], $actual->getAlternateVerificationKeys()[$i]);
     }
     $test->assertEquals(count($expected->getRequiredClaims()), count($actual->getRequiredClaims()));
     for ($i = 0; $i < count($expected->getRequiredClaims()); ++$i) {
         self::assertEqualsRequiredClaim($test, $expected->getRequiredClaims()[$i], $actual->getRequiredClaims()[$i]);
     }
     if ($expected->getOpenIdConnectDiscoveryDocument() != null) {
         $test->assertNotNull($actual->getOpenIdConnectDiscoveryDocument());
         $test->assertEquals($expected->getOpenIdConnectDiscoveryDocument()->getOpenIdDiscoveryUri(), $actual->getOpenIdConnectDiscoveryDocument()->getOpenIdDiscoveryUri());
     } else {
         $test->assertNull($actual->getOpenIdConnectDiscoveryDocument());
     }
 }
Exemplo n.º 9
0
 /**
  * @Then I should see :value in the :tag element
  */
 public function iShouldSeeInTheElement($value, $tag)
 {
     $page = $this->getSession()->getPage();
     $el = $page->find('css', $tag);
     Assertions::assertNotNull($el);
     $actual = $el->getText();
     Assertions::assertContains($value, $actual);
 }