public function cmp_ok($exp1, $op, $exp2, $message = '')
 {
     switch ($op)
     {
         case '==':
         case '===':
             assertEquals($exp2, $exp1);
             break;
         case '!=':
         case '!==':
             assertNotEquals($exp2, $exp1);
             break;
         case '>':
             assertGreaterThan($exp2, $exp1);
             break;
         case '<':
             assertLessThan($exp2, $exp1);
             break;
         case '>=':
             assertGreaterThanOrEqual($exp2, $exp1);
             break;
         case '<=':
             assertLessThanOrEqual($exp2, $exp1);
             break;
     }
 }
 /**
  * @param string    $field
  * @param TableNode $table
  *
  * @Then /^the scopable "([^"]*)" field should have the following colors:$/
  */
 public function theScopableFieldShouldHaveTheFollowingColors($field, TableNode $table)
 {
     $element = $this->getCurrentPage()->find('css', sprintf('label:contains("%s")', $field))->getParent();
     $colors = $this->getMainContext()->getContainer()->getParameter('pim_enrich.colors');
     foreach ($table->getHash() as $item) {
         $style = $element->find('css', sprintf('label[title="%s"]', $item['scope']))->getAttribute('style');
         assertGreaterThanOrEqual(1, strpos($style, $colors[$item['background']]), sprintf('Expecting the background of the %s %s field to be %s', $item['scope'], $field, $item['background']));
         assertGreaterThanOrEqual(1, strpos($style, $item['font']), sprintf('Expecting the font of the %s %s field to be %s', $item['scope'], $field, $item['font']));
     }
 }
示例#3
0
 public function test_it_can_get_paginated_list_of_users()
 {
     $output = $this->UsersRepository->users();
     assertGreaterThanOrEqual(1, $output->count());
     // atleast 1 user in seeds
 }
 /**
  * @Given /^data has more than (\d+) items/
  */
 public function dataHasMoreThanItems($arg)
 {
     $results = $this->getResponsePayload();
     assertGreaterThanOrEqual($arg, $results->data);
 }
 /**
  * @Then :alt_text ボタンが表示されていること
  */
 public function ボタンが表示されていること($alt_text)
 {
     $page = $this->getSession()->getPage();
     $images = $page->findAll('xpath', "//img[@alt='{$alt_text}']");
     assertGreaterThanOrEqual(1, $images);
 }
 /**
  * @Then Assert the value :arg1 is greater than :arg2 or equal
  * @param $expected
  * @param $actual
  */
 public function assertGreaterThanOrEqual($actual, $expected)
 {
     assertGreaterThanOrEqual($expected, $actual, sprintf("Assert the value [%s] is greater than [%s] or equal", $actual, $expected));
 }