<commit_before><?php

/*
 * This file is part of the Lob.com PHP Client.
 *
 * (c) 2013 Lob.com, https://www.lob.com
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Lob\Tests;

use Lob\Lob;
use Lob\Exception\ValidationException;

abstract class ResourceTest extends \PHPUnit_Framework_TestCase
{
    protected $lob;
    protected $resource;
    protected $resourceMethodName;
    protected $testSampleAll;
    protected $testSampleAllWithMeta;
    protected $respondsToAll = true;
    protected $respondsToAllWithCountOffset = true;
    protected $respondsToGet = true;
    protected $respondsToCreate = true;
    protected $respondsToDelete = true;
    public static $validCreateData = array();
    public static $invalidCreateData = array();

    protected function setUp()
    {
        $this->lob = new Lob('test_7c5d111af5ccfedb9f0eea91745c93896a1');
        $this->resource = $this->lob->{$this->resourceMethodName}();
        if (!$this->respondsToAll)
          return;

        $this->testSampleAll = $this->resource->all();

        $this->testSampleAllWithMeta = $this->resource->all(array(), true);
    }

    protected function getTestSampleAll()
    {
        if ($this->testSampleAll) {<commit_msg>Switching test over to use constant in phpunit.xml as per the readme<commit_after><?php

/*
 * This file is part of the Lob.com PHP Client.
 *
 * (c) 2013 Lob.com, https://www.lob.com
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Lob\Tests;

use Lob\Lob;
use Lob\Exception\ValidationException;

abstract class ResourceTest extends \PHPUnit_Framework_TestCase
{
    protected $lob;
    protected $resource;
    protected $resourceMethodName;
    protected $testSampleAll;
    protected $testSampleAllWithMeta;
    protected $respondsToAll = true;
    protected $respondsToAllWithCountOffset = true;
    protected $respondsToGet = true;
    protected $respondsToCreate = true;
    protected $respondsToDelete = true;
    public static $validCreateData = array();
    public static $invalidCreateData = array();

    protected function setUp()
    {
        $this->lob = new Lob(LOB_TEST_API_KEY);
        $this->resource = $this->lob->{$this->resourceMethodName}();
        if (!$this->respondsToAll)
          return;

        $this->testSampleAll = $this->resource->all();

        $this->testSampleAllWithMeta = $this->resource->all(array(), true);
    }

    protected function getTestSampleAll()
    {
        if ($this->testSampleAll) {
{'fraction_non_alphanumeric': 0.10909777274443186, 'fraction_numerical': 0.010192525481313703, 'mean_word_length': 3.4688026981450255, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 1}, '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': '4870637', 'n_tokens_mistral': 797, 'n_tokens_neox': 778, 'n_words': 207}