Index: tests/phpunit/tests/customize/nav-menus-ajax.php
===================================================================
--- tests/phpunit/tests/customize/nav-menus-ajax.php	(revision 0)
+++ tests/phpunit/tests/customize/nav-menus-ajax.php	(working copy)
@@ -0,0 +1,347 @@
+<?php
+
+/**
+ * Testing the Ajax method functionality
+ *
+ * @package    WordPress
+ * @subpackage UnitTests
+ * @since      4.3.0
+ * @group      customize
+ */
+class Test_WP_Customize_Nav_Menus_Ajax extends WP_Ajax_UnitTestCase {
+
+	/**
+	 * Instance of WP_Customize_Manager which is reset for each test.
+	 *
+	 * @var WP_Customize_Manager
+	 */
+	public $wp_customize;
+
+
+	/**
+	 * Set up the test fixture.
+	 */
+	public function setUp() {
+		parent::setUp();
+		require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
+		wp_set_current_user( $this->factory->user->create( array( 'role' => 'administrator' ) ) );
+		global $wp_customize;
+		$this->wp_customize = new WP_Customize_Manager();
+		$wp_customize = $this->wp_customize;
+	}
+
+	/**
+	 * Tear down the test fixture.
+	 */
+	public function tearDown() {
+		parent::tearDown();
+	}
+
+
+	/**
+	 * Helper to keep it DRY
+	 * @param $action
+	 */
+	protected function make_ajax_call( $action ) {
+		// Make the request
+		try {
+			$this->_handleAjax( $action );
+		} catch ( WPAjaxDieContinueException $e ) {
+			unset( $e );
+		}
+	}
+
+
+	/**
+	 * Testing capabilities check for ajax_load_available_items method
+	 *
+	 * @dataProvider data_ajax_load_available_items_cap_check
+	 *
+	 * @param string $role The role we're checking caps against
+	 * @param array $expected_results
+	 */
+	function test_ajax_load_available_items_cap_check( $role, $expected_results ) {
+
+		wp_set_current_user( $this->factory->user->create( array( 'role' => $role ) ) );
+
+		$_POST = array(
+			'action'                => 'load-available-menu-items-customizer',
+			'customize-menus-nonce' => wp_create_nonce( 'customize-menus' ),
+		);
+
+		$this->make_ajax_call( 'load-available-menu-items-customizer' );
+
+		//get the results
+		$response = json_decode( $this->_last_response, true );
+
+		$this->assertSame( $expected_results, $response );
+
+	}
+
+	/**
+	 *
+	 * Data provider.
+	 *
+	 * Provides various post_args to induce error messages in the that can be
+	 * compared to the expected_results.
+	 *
+	 * @since 4.3.0
+	 *
+	 * @see test_ajax_load_available_items_cap_check
+	 *
+	 * @return array {
+	 *     @string string $role             The role that will test caps for.
+	 *     @array  array  $expected_results The expected results from the ajax call.
+	 * }
+	 *
+	 */
+	function data_ajax_load_available_items_cap_check() {
+		return array(
+			array(
+				'subscriber',
+				array(
+					'success' => false,
+					'data' => array(
+						'message' => 'Error: invalid user capabilities.',
+					),
+				),
+			),
+			array(
+				'contributor',
+				array(
+					'success' => false,
+					'data' => array(
+						'message' => 'Error: invalid user capabilities.',
+					),
+				),
+			),
+			array(
+				'author',
+				array(
+					'success' => false,
+					'data' => array(
+						'message' => 'Error: invalid user capabilities.',
+					),
+				),
+			),
+			array(
+				'editor',
+				array(
+					'success' => false,
+					'data' => array(
+						'message' => 'Error: invalid user capabilities.',
+					),
+				),
+			),
+			array(
+				'administrator',
+				array(
+					'success' => false,
+					'data' => array(
+						'message' => 'Missing obj_type or type param.',
+					),
+				),
+			),
+		);
+	}
+
+
+	/**
+	 * Testing the error messaging for ajax_load_available_items
+	 *
+	 * @dataProvider data_ajax_load_available_items_error_messages
+	 *
+	 */
+	function test_ajax_load_available_items_error_messages( $post_args, $expected_results ) {
+
+		$_POST = array_merge( array(
+			'action'                => 'load-available-menu-items-customizer',
+			'customize-menus-nonce' => wp_create_nonce( 'customize-menus' ),
+		), $post_args );
+
+
+		// Make the request
+		$this->make_ajax_call( 'load-available-menu-items-customizer' );
+
+		//get the results
+		$response = json_decode( $this->_last_response, true );
+
+		$this->assertSame( $expected_results, $response );
+	}
+
+
+	/**
+	 *
+	 * Data provider.
+	 *
+	 * Provides various post_args to induce error messages in the that can be
+	 * compared to the expected_results.
+	 *
+	 * @since 4.3.0
+	 *
+	 * @see test_ajax_load_available_items_error_messages
+	 *
+	 * @return array {
+	 *     @array array $post_args        The arguments that will merged with the $_POST array.
+	 *     @array array $expected_results The expected results from the ajax call.
+	 * }
+	 *
+	 */
+	function data_ajax_load_available_items_error_messages() {
+		return array(
+			/**
+			 * Testing empty obj_type and type
+			 */
+			array(
+				array(
+					'obj_type'  => '',
+					'type'      => '',
+				),
+
+				array(
+					'success' => false,
+					'data' => array(
+						'message' => 'Missing obj_type or type param.',
+					),
+				),
+			),
+			/**
+			 * Testing empty obj_type
+			 */
+			array(
+				array(
+					'obj_type'  => '',
+					'type'      => 'post',
+				),
+
+				array(
+					'success' => false,
+					'data' => array(
+						'message' => 'Missing obj_type or type param.',
+					),
+				),
+			),
+			/**
+			 * Testing empty type
+			 */
+			array(
+
+				array(
+					'obj_type'  => '',
+					'type'      => 'post',
+				),
+				array(
+					'success' => false,
+					'data' => array(
+						'message' => 'Missing obj_type or type param.',
+					),
+				),
+			),
+			/**
+			 * Testing incorrect obj_type option
+			 */
+			array(
+				array(
+					'obj_type'  => 'invalid',
+					'type'      => 'post',
+				),
+
+				array(
+					'success' => false,
+					'data' => array(
+						'message' => 'Invalid obj_type param: invalid',
+					),
+				),
+			),
+
+			/**
+			 * Testing incorrect type option
+			 */
+			array(
+				array(
+					'obj_type'  => 'post_type',
+					'type'      => 'invalid',
+				),
+
+				array(
+					'success' => false,
+					'data' => array(
+						'message' => 'Unknown post type.',
+					),
+				),
+			),
+		);
+	}
+
+
+	/**
+	 * Testing the success status
+	 *
+	 * @dataProvider data_ajax_load_available_items_sucess_status
+	 */
+	function test_ajax_load_available_items_sucess_status( $post_args, $success_status ) {
+
+		$_POST = array_merge( array(
+			'action'                => 'load-available-menu-items-customizer',
+			'customize-menus-nonce' => wp_create_nonce( 'customize-menus' ),
+		), $post_args );
+
+		// Make the request
+		$this->make_ajax_call( 'load-available-menu-items-customizer' );
+
+		//get the results
+		$response = json_decode( $this->_last_response, true );
+		$this->assertSame( $success_status, $response['success'] );
+
+	}
+
+	/**
+	 *
+	 * Data provider.
+	 *
+	 * Provides various post_args to retrieve results and compare against
+	 * the success status.
+	 *
+	 * @since 4.3.0
+	 *
+	 * @see test_ajax_load_available_items_sucess_status
+	 *
+	 * @return array {
+	 *     @type array $post_args      The arguments that will merged with the $_POST array.
+	 *     @type bool  $success_status The expected success status.
+	 * }
+	 *
+	 */
+	function data_ajax_load_available_items_sucess_status() {
+		return array(
+			array(
+				array(
+					'obj_type'  => 'post_type',
+					'type'      => 'post',
+				),
+				true,
+			),
+			array(
+				array(
+					'obj_type'  => 'post_type',
+					'type'      => 'page',
+				),
+				true,
+			),
+			array(
+				array(
+					'obj_type'  => 'post_type',
+					'type'      => 'custom',
+				),
+				false,
+			),
+			array(
+				array(
+					'obj_type'  => 'taxonomy',
+					'type'      => 'post_tag',
+				),
+				true,
+			),
+		);
+	}
+}
\ No newline at end of file
Index: tests/phpunit/tests/customize/nav-menus.php
===================================================================
--- tests/phpunit/tests/customize/nav-menus.php	(revision 33152)
+++ tests/phpunit/tests/customize/nav-menus.php	(working copy)
@@ -48,17 +48,7 @@
 		$this->assertInstanceOf( 'WP_Customize_Manager', $menus->manager );
 	}
 
-	/**
-	 * Test the test_load_available_items_ajax method.
-	 *
-	 * @see WP_Customize_Nav_Menus::load_available_items_ajax()
-	 */
-	function test_load_available_items_ajax() {
 
-		$this->markTestIncomplete( 'This test has not been implemented.' );
-
-	}
-
 	/**
 	 * Test the search_available_items_ajax method.
 	 *
