is_package_shippable( array( 'destination' => array( 'country' => '', 'state' => 'CA', 'postcode' => '99999', 'address' => '', ), ) ); $this->assertFalse( $result ); // Failure for disallowed country. $result = $shipping->is_package_shippable( array( 'destination' => array( 'country' => 'TEST', 'state' => 'CA', 'postcode' => '99999', 'address' => '', ), ) ); $this->assertFalse( $result ); // Failure for no state when required. $result = $shipping->is_package_shippable( array( 'destination' => array( 'country' => 'US', 'state' => '', 'postcode' => '99999', 'address' => '', ), ) ); $this->assertFalse( $result ); // Success for correct address. $result = $shipping->is_package_shippable( array( 'destination' => array( 'country' => 'US', 'state' => 'CA', 'postcode' => '99999', 'address' => '', ), ) ); $this->assertTrue( $result ); } }