<commit_before><?php
require_once dirname(__FILE__) . '/config.php';
require_once dirname(__FILE__) . '/../FormstackApi.php';

/**
 * This test code runs on PHPUnit 4.0. You will need to install PHPUnit as
 * described at http://phpunit.de/manual/current/en/installation.html before
 * you can successfully run these tests for yourself.
 *
 * NOTE: This Test Code depends on a config file containing constants used throughout
 * this code. You must create and reference your config file with the proper values.
 *
 * NOTE: This Test Code makes numerous API Calls to the Formstack API when run.
 * It's inadvisable to use this test code with Access Token(s) utilized in
 * production, as the Formstack API is rate limited to 14,400 requests a day.
 */

/**
 * @coversDefaultClass \FormstackApi
 */
class WrapperTest extends PHPUnit_Framework_TestCase {

    /**
     * @covers                      ::request
     * @expectedException           Exception
     * @expectedExceptionMessage    You must include an enpoint to request
     */
    public function testRequestEmptyEndpoint() {
        $wrapper = new FormstackApi(ACCESS_TOKEN);
        $wrapper->request('');
    }

    /**
     * @covers                      ::request
     * @expectedException           Exception
     * @expectedExceptionMessage    Your requests must be performed with one of the following
     * verbs: GET, PUT, POST, DELETE.
     */
    public function testRequestBadVerb() {
        $wrapper = new FormstackApi(ACCESS_TOKEN);
        $wrapper->request('/test/endpoint', 'FAIL');
    }<commit_msg>Add notice about potentially destructive tests<commit_after><?php
require_once dirname(__FILE__) . '/config.php';
require_once dirname(__FILE__) . '/../FormstackApi.php';

/**
 * This test code runs on PHPUnit 4.0. You will need to install PHPUnit as
 * described at http://phpunit.de/manual/current/en/installation.html before
 * you can successfully run these tests for yourself.
 *
 * NOTE: This Test Code depends on a config file containing constants used throughout
 * this code. You must create and reference your config file with the proper values.
 *
 * NOTE: This Test Code makes numerous API Calls to the Formstack API when run.
 * It's inadvisable to use this test code with Access Token(s) utilized in
 * production, as the Formstack API is rate limited to 14,400 requests a day.
 *
 * NOTE: Some of these API requests are destructive. Ensure that the constants
 * defined in your own config.php file are for Submissions/Forms/etc. that you
 * are OK with losing.
 */

/**
 * @coversDefaultClass \FormstackApi
 */
class WrapperTest extends PHPUnit_Framework_TestCase {

    /**
     * @covers                      ::request
     * @expectedException           Exception
     * @expectedExceptionMessage    You must include an enpoint to request
     */
    public function testRequestEmptyEndpoint() {
        $wrapper = new FormstackApi(ACCESS_TOKEN);
        $wrapper->request('');
    }

    /**
     * @covers                      ::request
     * @expectedException           Exception
     * @expectedExceptionMessage    Your requests must be performed with one of the following
     * verbs: GET, PUT, POST, DELETE.
     */
    public function testRequestBadVerb() {
        $wrapper = new FormstackApi(ACCESS_TOKEN);
        $wrapper->request('/test/endpoint', 'FAIL');
    }
{'fraction_non_alphanumeric': 0.08745923510228283, 'fraction_numerical': 0.004150607767565965, 'mean_word_length': 2.891580161476355, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '205478', 'n_tokens_mistral': 883, 'n_tokens_neox': 857, 'n_words': 336}