-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest_qq_acf.php
75 lines (61 loc) · 1.47 KB
/
test_qq_acf.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/**
* Tests that we get ACF data for posts where applicable
*
* @package wordpress-plugins-tests
*/
class WP_QQ_ACF extends WP_UnitTestCase {
public static function setUpBeforeClass () {
if(function_exists("register_field_group")) {
register_field_group(array (
'id' => 'acf_test-post-data',
'title' => 'Test Post data',
'fields' => array (
array (
'key' => 'field_53b71bb393d1a',
'label' => 'Test ACF',
'name' => 'test_acf',
'type' => 'text',
'instructions' => 'just add some text, yo',
'default_value' => 'foo to the bar',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'post',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'normal',
'layout' => 'no_box',
'hide_on_screen' => array (
),
),
'menu_order' => 0,
));
}
}
function test_acf_found() {
// $qq = new QQuery();
// $this->assertTrue($qq->uses_acf, 'ACF exists');
}
function test_acf_data() {
// $post_id = $this->factory->post->create( );
// $qq = new QQuery();
// // fetch that post via QQ
// $qq_post = $qq->get( $post_id );
// print_r( get_fields($post_id) );
// $this->assertObjectHasAttribute('acf', $qq_post);
}
}