Test_Import::test_set_values_exceptions()


Source

File: tests/test-import.php

	public function test_set_values_exceptions() {

		$item['ID'] = -1;

		$this->expectException(\Exception::class);

		$recipe_id = $this->importer->set_values( $item );

		$item['fields'] = array (
			0 => 
			array (
			  'meta' => 'EMAILFROM',
			  'value' => '{{admin_email}}',
			),
			1 => 
			array (
			  'meta' => 'EMAILFROMNAME',
			  'value' => 'PHPUnit',
			),
			2 => 
			array (
			  'meta' => 'EMAILTO',
			  'value' => '{{admin_email}}',
			),
		);

		$this->expectException(\Exception::class);

		$recipe_id = $this->importer->set_values( $item );

	}