Skip to content
Snippets Groups Projects
TestsTest.php 1.35 KiB
Newer Older
  • Learn to ignore specific revisions
  • <?php
    
    
    namespace calderawp\CalderaFormsQuery\Tests\Integration;
    
    
    Josh Pollock's avatar
    Josh Pollock committed
    use calderawp\CalderaFormsQuery\SelectsCreatesSelect;
    
    Josh Pollock's avatar
    Josh Pollock committed
    use calderawp\CalderaFormsQuery\Select\Entry;
    use calderawp\CalderaFormsQuery\Select\EntryValues;
    
    
    /**
     * Class TestsTest
     *
     * Tests to ensure integration test environment is working
     * @package calderawp\CalderaFormsQuery\Tests\Integration
     */
    class TestsTest extends IntegrationTestCase
    {
    
    Josh Pollock's avatar
    Josh Pollock committed
    	//Using this so we can test that CF's testing traits are available
    	use \Caldera_Forms_Has_Mock_Form;
    
    
    	/**
    	 * Check that Caldera Forms is usable
    	 */
    	public function testCalderaFormsIsInstalled()
    	{
    		$this->assertTrue( defined( 'CFCORE_VER' ) );
    		$this->assertTrue( class_exists( '\Caldera_Forms' ) );
    	}
    
    
    Josh Pollock's avatar
    Josh Pollock committed
    	/**
    	 * Make sure the trait worked
    	 */
    	public function testMockForm()
    	{
    		$this->set_mock_form();
    		$this->assertTrue( is_array( $this->mock_form  ) );
    	}
    
    	/**
    	 * Test that factories work for integration tests
    	 *
    	 * @covers HasFactories::entryQueriesFactory()
    	 * @covers HasFactories::entryValuesGeneratorFactory()
    	 * @covers HasFactories::entryGeneratorFactory()
    	 */
    	public function testFactory()
    	{
    
    Josh Pollock's avatar
    Josh Pollock committed
    		$this->assertTrue(is_a($this->entryQueriesFactory(), SelectsCreatesSelect::class));
    
    Josh Pollock's avatar
    Josh Pollock committed
    		$this->assertTrue(is_a($this->entryValuesGeneratorFactory(), EntryValues::class));
    		$this->assertTrue(is_a($this->entryGeneratorFactory(), Entry::class));
    
    	}