Add these posts to this wordpress installation

@see wp_insert_post

@Given /^there are posts$/
973292
public function thereArePosts(TableNode $table)
    {
        foreach ($table->getHash() as $postData) {
            if (!is_int(wp_insert_post($postData))) {
                throw new \InvalidArgumentException("Invalid post information schema.");
            }
        }
    }
89728
public function addMetaBoxes()
    {
	// Publish
	add_meta_box(
	    'modularity-mb-publish',
	    __('Save options', 'modularity'),
	    function () {
		$templatePath = \Modularity\Helper\Wp::getTemplate('publish', 'options/partials');
		include $templatePath;
	    },
	    $this->screenHook,
	    'side'
	);

	// Core options
	add_meta_box(
	    'modularity-mb-core-options',
	    __('Core options', 'modularity'),
	    function () {
		$templatePath = \Modularity\Helper\Wp::getTemplate('core-options', 'options/partials');
		include $templatePath;
	    },
	    $this->screenHook,
	    'normal'
	);

	if (has_action('Modularity/Options/Module')) {
	    add_meta_box(
		'modularity-mb-module-options',
		__('Module options', 'modularity'),
		function () {
		    do_action('Modularity/Options/Module');
		},
		$this->screenHook,
		'normal'
	    );
	}

	// Modules
	add_meta_box(
	    'modularity-mb-post-types',
	    __('Post types', 'modularity'),
	    array($this, 'metaBoxPostTypes'),
	    $this->screenHook,
	    'normal'
	);

	// Templates and areas
	add_meta_box(
	    'modularity-mb-template-areas',
	    __('Template areas', 'modularity'),
	    array($this, 'metaBoxTemplateAreas'),
	    $this->screenHook,
	    'normal'
	);

	// Modules
	add_meta_box(
	    'modularity-mb-modules',
	    __('Modules', 'modularity'),
	    array($this, 'metaBoxModules'),
	    $this->screenHook,
	    'normal'
	);
    }
264114
public function post()
    {
        $this->setPostedAt(new \DateTime());

        // Post each line
        foreach ($this->getLineItems() as $lineItem) {
            $lineItem->post();
        }
    }
155404
public function add(): void
    {
        $menu = $this->Menus->newEntity();
        if ($this->request->is('post')) {
            $data = (array)$this->request->getData();
            $menu = $this->Menus->patchEntity($menu, $data);
            if ($this->Menus->save($menu)) {
                $this->Flash->success((string)__('The menu has been saved.'));
                $this->redirect(['action' => 'index']);

                return;
            } else {
                $this->Flash->error((string)__('The menu could not be saved. Please, try again.'));
            }
        }
        $this->set('navMenu', $menu);
        $this->set('_serialize', ['navMenu']);
    }
173712
public function add_hook() {

		add_filter(
			'post_type_link',
			array( $this, 'post_type_link' ),
			apply_filters( 'cptp_post_type_link_priority', 0 ),
			4
		);

		add_filter(
			'term_link',
			array( $this, 'term_link' ),
			apply_filters( 'cptp_term_link_priority', 0 ),
			3
		);

		add_filter(
			'attachment_link',
			array( $this, 'attachment_link' ),
			apply_filters( 'cptp_attachment_link_priority', 20 ),
			2
		);
	}
448390
public function addPost(Post $post)
    {
        $postName = $post->getName();

        if ($this->isPostRegistered($postName)) {
            throw new \InvalidArgumentException("Duplicate post $postName");
        }

        $this->registerPost($post);
    }
138231
public function init()
    {
        global $post;
        global $wp_query;

        if (is_admin() || is_feed() || is_tax() || post_password_required()) {
            return;
        }

        $archiveSlug = \Modularity\Helper\Wp::getArchiveSlug();

        if (isset($wp_query->query['modularity_template']) && !empty($wp_query->query['modularity_template'])) {
            $this->modules = \Modularity\Editor::getPostModules($wp_query->query['modularity_template']);
            $this->options = get_option('modularity_' . $wp_query->query['modularity_template'] . '_sidebar-options');
        } elseif ($archiveSlug) {
            $this->modules = \Modularity\Editor::getPostModules($archiveSlug);
            $this->options = get_option('modularity_' . $archiveSlug . '_sidebar-options');
        } else {
            $this->modules = \Modularity\Editor::getPostModules($post->ID);
            $this->options = get_post_meta($post->ID, 'modularity-sidebar-options', true);
        }

        add_action('dynamic_sidebar_before', array($this, 'outputBefore'));
        add_action('dynamic_sidebar_after', array($this, 'outputAfter'));

        add_filter('sidebars_widgets', array($this, 'hideWidgets'));
    }
537358
public function init() {

		$posts = array();

		if ( ! $posts = wp_cache_get( 'sidebars', 'custom_sidebars' ) ) {
			$args = array(
				'post_type' => Custom_Sidebars::get_post_types(),
				'meta_query' => array(
					array(
						'key'   => '_custom_sidebar',
						'value' => true,
					)
				)
			);

			$query = new WP_Query( $args );

			if ( $query->have_posts() ) {
				$posts = $query->posts;
			}

			wp_cache_set( 'sidebars', 'custom_sidebars' );
		}

		foreach ( $posts as $post ) {
			$args = apply_filters( 'custom_sidebar_args', array(
				'name'          => sprintf( __( 'Sidebar: %s', 'custom_sidebars' ), $post->post_title ),
				'id'            => $this->get_sidebar_id( $post->ID ),
				'description'   => sprintf( __( 'This sidebar will appear on the %s single page.', 'cd-sidebar' ), $post->post_title ),
				'class'         => '',
				'before_widget' => '<aside id="%1$s" class="widget %2$s">',
				'after_widget'  => '</aside>',
				'before_title'  => '<h2 class="widget-title">',
				'after_title'   => '</h2>',
			) );

			register_sidebar( $args );
		}

	}
551964
protected function addPostField($key)
    {
        if (property_exists($this, $key)) {
            $this->postFields[$key] = $this->$key;
        }
    }
682532
function maybe_add_pointers() {
    // Get default pointers that we want to create
    $default_keys = $this->initial_pointers();

    // Get pointers dismissed by user
    $dismissed = explode( ',', get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );

    // Check that our pointers haven't been dismissed already
    $diff = array_diff_key( $default_keys, array_combine( $dismissed, $dismissed ) );

    // If we have some pointers to show, save them and start enqueuing assets to display them
    if ( !empty( $diff ) ) {
	$this->pointers = $diff;
	add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_assets' ) );

	foreach ( $diff as $pointer ) {
	  if ( isset( $pointer[ 'phpcode' ] ) ) {
	    add_action( 'admin_notices', $pointer[ 'phpcode' ] );
	  }
	}
    }
    $this->pointers[ 'l10n' ] = array( 'next' => __( 'Next' ) );
  }
1125632
function it_should_be_possible_to_add_a_post_to_feed($post1, $post2)
    {
        $post1->getUniqueIdentifier()->willReturn('id1');
        $post2->getUniqueIdentifier()->willReturn('id2');

        $this->addPost($post1)->shouldReturn($this);
        $this->addPost($post2)->shouldReturn($this);

        $this->getPost('id1')->shouldReturn($post1);
        $this->getPost('id2')->shouldReturn($post2);

        $iterator = $this->getIterator();
    }
107921
public function add()
    {
        $this->request->allowMethod('post');

        $entity = $this->SavedSearches->newEntity();
        $entity = $this->SavedSearches->patchEntity($entity, (array)$this->request->getData());
        $success = (bool)$this->SavedSearches->save($entity);

        $this->set('success', $success);
        $success ?
            $this->set('data', ['id' => $entity->get('id')]) :
            $this->set('error', $entity->getErrors());
        $this->set('_serialize', ['success', 'data', 'error']);
    }
1108737
public function add()
    {
        $this->dirs = array_merge($this->dirs, func_get_args());
        $this->dirs = array_filter($this->dirs);
        $this->dirs = array_values($this->dirs);
    }
1262790
function addLinkFns(pre, post) {
        if (pre) {
          pre.require = directive.require;
          preLinkFns.push(pre);
        }
        if (post) {
          post.require = directive.require;
          postLinkFns.push(post);
        }
      }
239433
private function add_relationships($post_type)
    {
        if (! empty($this->taxonomies)) {
            $filters = [];

            foreach ($this->taxonomies as $k => $v) {
                // Add all taxonomies to $filters unless explicitly declared otherwise.
                if (\is_integer($k)) {
                    $post_type->taxonomy($v);
                    $filters[] = $v;
                    continue;
                }

                if ($v === false) {
                    $post_type->taxonomy($k);
                }
            }

            $post_type->filters($filters);
        }
    }
290371
protected function modifyPostBuild()
    {
        foreach ($this->modifications[ModifiableInterface::PHASE_POST_BUILD] as $mod) {
            $this->modify($mod);
        }
    }
1371237
public function install()
    {
        // 1. Set options
        $this->setOptions($this->config->options());

        // 2. Activate plugins
        $this->activatePlugins($this->config->plugins());

        // 3. Maybe set the theme (and settings)
        if ($theme = $this->config->theme()) {
            $this->setTheme($theme->name, $theme->mods, $theme->options, $theme->menus, $theme->sidebars);
        }

        // 4. Maybe set the permalink structure
        global $wp_rewrite;
        if ($wp_rewrite && $permalinks = $this->config->permalinks()) {
            $this->setPermalinkStructure($wp_rewrite, $permalinks);
        }

        // 5. Maybe set the timezone
        if ($timezone = $this->config->timezone()) {
            $this->setTimezone($timezone);
        }
    }