wp-pay-gateways    /
                    ogone
                
                            | 1 | <?php  | 
            ||
| 2 | |||
| 3 | namespace Pronamic\WordPress\Pay\Gateways\Ingenico;  | 
            ||
| 4 | |||
| 5 | use DateTime;  | 
            ||
| 6 | |||
| 7 | /**  | 
            ||
| 8 | * Title: Ogone data default helper class test  | 
            ||
| 9 | * Description:  | 
            ||
| 10 | * Copyright: 2005-2019 Pronamic  | 
            ||
| 11 | * Company: Pronamic  | 
            ||
| 12 | *  | 
            ||
| 13 | * @author Remco Tolsma  | 
            ||
| 14 | * @version 2.0.0  | 
            ||
| 15 | * @since 1.1.0  | 
            ||
| 16 | */  | 
            ||
| 17 | class DataCreditCardHelperTest extends \WP_UnitTestCase { | 
            ||
| 18 | /**  | 
            ||
| 19 | * Test helper.  | 
            ||
| 20 | */  | 
            ||
| 21 | 	public function test_helper() { | 
            ||
| 22 | $data = new Data();  | 
            ||
| 23 | |||
| 24 | $helper = new DataCreditCardHelper( $data );  | 
            ||
| 25 | |||
| 26 | $ed = new DateTime();  | 
            ||
| 27 | |||
| 28 | $helper  | 
            ||
| 29 | ->set_number( '378282246310005' )  | 
            ||
| 
                                                                                                    
                         0 ignored issues 
                            –
                            show
                                    Bug
    
    
    
        introduced 
                            by  
        
   Loading history...
                 | 
                |||
| 30 | ->set_expiration_date( $ed )  | 
            ||
| 31 | ->set_security_code( '123' );  | 
            ||
| 32 | |||
| 33 | $this->assertEquals(  | 
            ||
| 34 | array(  | 
            ||
| 35 | 'CARDNO' => '378282246310005',  | 
            ||
| 36 | 'ED' => $ed->format( Ingenico::EXPIRATION_DATE_FORMAT ),  | 
            ||
| 37 | 'CVC' => '123',  | 
            ||
| 38 | ),  | 
            ||
| 39 | $data->get_fields()  | 
            ||
| 40 | );  | 
            ||
| 41 | }  | 
            ||
| 42 | }  | 
            ||
| 43 |