/**
  * Test that we can query for these tests properly
  *
  * @since 1.1.0
  *
  * @group group
  * @group destination
  * @group cookie
  * @group destination_cookie
  *
  * @covers \ingot\testing\tests\click\destination\init::get_destination_tests()
  */
 public function testQuery()
 {
     ingot_test_data_price::edd_tests();
     ingot_tests_data::make_groups();
     $x = 0;
     foreach (\ingot\testing\tests\click\destination\types::destination_types() as $type) {
         if ('hook' == $type) {
             continue;
         }
         $data = ingot_test_desitnation::create($type);
         $this->assertTrue(is_numeric($data['group_ID']));
         $the_groups[] = $data['group_ID'];
         $x++;
     }
     $groups = \ingot\testing\tests\click\destination\init::get_destination_tests();
     $this->assertSame($x, count($groups));
     $this->assertEquals($the_groups, $groups);
 }
Exemplo n.º 2
0
 /**
  * Data needed in app
  *
  * @since 0.2.0
  *
  * @access protected
  *
  * @return array
  */
 protected function vars()
 {
     return array('api' => esc_url_raw(util::get_url()), 'nonce' => wp_create_nonce('wp_rest'), 'partials' => esc_url_raw(INGOT_URL . 'assets/admin/partials/'), 'spinner_url' => trailingslashit(INGOT_URL) . 'assets/img/loading.gif', 'edd_active' => esc_attr(ingot_is_edd_active()), 'woo_active' => esc_attr(ingot_is_woo_active()), 'price_tests_enabled' => esc_attr(ingot_enable_price_testing()), 'click_type_options' => types::allowed_click_types(true), 'price_type_options' => types::allowed_price_types(), 'destinations' => \ingot\testing\tests\click\destination\types::destination_types(true, true), 'dev_mode' => INGOT_DEV_MODE);
 }
 /**
  * Cehck getting destination from meta
  *
  * @since 1.1.0
  *
  * @group group
  * @group destination
  *
  * @covers \ingot\testing\utility\destination::get_destination()
  */
 public function testGetDestination()
 {
     foreach (\ingot\testing\tests\click\destination\types::destination_types() as $type) {
         if ('hook' == $type) {
             continue;
         }
         $args = ingot_test_desitnation::group_args($type);
         $data = ingot_test_desitnation::create($type);
         $group = \ingot\testing\crud\group::read($data['group_ID']);
         $this->assertEquals($type, \ingot\testing\utility\destination::get_destination($group));
     }
 }
Exemplo n.º 4
0
 /**
  * Test that we can create all sorts of destination tests
  *
  * @since 1.1.0
  *
  * @group group
  * @group group_crud
  * @group destination
  *
  * @covers  \ingot\testing\crud\group::create()
  * @covers \ingot\testing\crud\crud::save()
  * @covers \ingot\testing\tests\click\destination\types::destination_types()
  * @covers \ingot\testing\utility\destination::prepare_meta()
  */
 public function testCreateDestinationTest()
 {
     foreach (\ingot\testing\tests\click\destination\types::destination_types() as $type) {
         if ('hook' == $type) {
             continue;
         }
         $args = ingot_test_desitnation::group_args($type);
         $id = \ingot\testing\crud\group::create($args);
         $this->assertTrue(is_numeric($id));
         $group = \ingot\testing\crud\group::read($id);
         $this->assertInternalType('array', $group);
         $this->assertTrue(\ingot\testing\crud\group::valid($group));
     }
 }