<commit_before><?php

use WP_CLI_Dotenv\Fixtures;
use WP_CLI_Dotenv\Salts\Salts;
use Illuminate\Support\Collection;

class SaltsTest extends PHPUnit_Framework_TestCase
{
    use Fixtures;

    /**
     * @test
     */
    function it_parses_the_php_from_the_wordpress_generator_into_an_array()
    {
        $salts = StubSalts::collect();

        $this->assertInstanceOf(Collection::class, $salts);

        $this->assertEquals($salts->all(),
            [
                ['AUTH_KEY'         , <KEY>'],
                ['SECURE_AUTH_KEY'  , '#ISZfl8<$4hUN}-hMY|Q>Utt.;vQ2Wi1+n|[<KEY>)(%_| L/!]|$9W(_s'],
                ['LOGGED_IN_KEY'    , '^<KEY>},Q+n(uR#}xqeH|y.]R0S'],
                ['NONCE_KEY'        , '<KEY>'],
                ['AUTH_SALT'        , 'cKkVFNG<zd|*X-bzM]*_0zf$,VqQfFI9j| ~DbOVY&RkwS1+C#$*[PXb+^c7=?5k'],
                ['SECURE_AUTH_SALT' , ' ;O3(wNH@!,*F$<^I-TI86E^`RvY9R(!~>h%3cY_AnJt4ze?b:dbP![Xf{F9_7n^'],
                ['LOGGED_IN_SALT'   , 'c+/,-o{]RCUjmGYd;n.!JZpMfR+PP$8- Tt&m}3JfZ5d%TccrzrIN9+UC^_eH):{'],
                ['NONCE_SALT'       , 'o*!J1UjHZ3-3GMgtZlnFh5MgT7Aw@.x_+q@,%(Tk4t:-A61niZXa1|/RbSbkG- :'],
            ]
        );
    }

    /**
     * @test
     * @expectedException Exception
     */
    function it_blows_up_if_the_wordpress_org_api_is_down()
    {
    	var_dump(BrokenSalts::fetch_array());
    }

}

class StubSalts extends Salts
{
    const GENERATOR_URL = __DIR__ . '/wp-org-api-generated-salts-php';
}

class BrokenSalts extends Salts
{
    const GENERATOR_URL = __DIR__ . '/wp-org-api-down';
}<commit_msg>remove dump from test<commit_after><?php

use WP_CLI_Dotenv\Fixtures;
use WP_CLI_Dotenv\Salts\Salts;
use Illuminate\Support\Collection;

class SaltsTest extends PHPUnit_Framework_TestCase
{
    use Fixtures;

    /**
     * @test
     */
    function it_parses_the_php_from_the_wordpress_generator_into_an_array()
    {
        $salts = StubSalts::collect();

        $this->assertInstanceOf(Collection::class, $salts);

        $this->assertEquals($salts->all(),
            [
                ['AUTH_KEY'         , <KEY>'],
                ['SECURE_AUTH_KEY'  , '#ISZfl8<$4hUN}-hMY|Q>Utt.;vQ2Wi1+n|[<KEY>)(%_| L/!]|$9W(_s'],
                ['LOGGED_IN_KEY'    , '^<KEY>R=R3{KhL?<p<F},Q+n(uR#}xqeH|y.]R0S'],
                ['NONCE_KEY'        , '<KEY>:<KEY>'],
                ['AUTH_SALT'        , 'cKkVFNG<zd|*X-bzM]*_0zf$,VqQfFI9j| ~DbOVY&RkwS1+C#$*[PXb+^c7=?5k'],
                ['SECURE_AUTH_SALT' , ' ;O3(wNH@!,*F$<^I-TI86E^`RvY9R(!~>h%3cY_AnJt4ze?b:dbP![Xf{F9_7n^'],
                ['LOGGED_IN_SALT'   , 'c+/,-o{]RCUjmGYd;n.!JZpMfR+PP$8- Tt&m}3JfZ5d%TccrzrIN9+UC^_eH):{'],
                ['NONCE_SALT'       , 'o*!J1UjHZ3-3GMgtZlnFh5MgT7Aw@.x_+q@,%(Tk4t:-A61niZXa1|/RbSbkG- :'],
            ]
        );
    }

    /**
     * @test
     * @expectedException Exception
     */
    function it_blows_up_if_the_wordpress_org_api_is_down()
    {
        BrokenSalts::fetch_array();
    }

}

class StubSalts extends Salts
{
    const GENERATOR_URL = __DIR__ . '/wp-org-api-generated-salts-php';
}

class BrokenSalts extends Salts
{
    const GENERATOR_URL = __DIR__ . '/wp-org-api-down';
}
{'fraction_non_alphanumeric': 0.1808443604284814, 'fraction_numerical': 0.020478890989287964, 'mean_word_length': 2.6120591581342434, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2194299', 'n_tokens_mistral': 1467, 'n_tokens_neox': 1396, 'n_words': 127}