<commit_before><?php

/**
 * w3w-php-wrapper - A PHP library to use the what3words RESTful API
 *
 * @author <NAME> <<EMAIL>>
 * @copyright 2016, 2017 what3words Ltd
 * @link http://developer.what3words.com
 * @license MIT
 * @version 3.0.0
 * @package What3words\Geocoder
 */

namespace What3words\Geocoder\Test;

use What3words\Geocoder\Geocoder;
use What3words\Geocoder\AutoSuggestOption;


class GeocoderTest extends \PHPUnit\Framework\TestCase
{
    protected $geocoder;

  protected function setUp()
    {
        $this->geocoder = new Geocoder(getenv('W3W_API_KEY'));
    }

    public function testBuildGeocoder()
    {
        $this->assertObjectHasAttribute('api_key', $this->geocoder);
    }

    public function testInvalidKey()
    {
        $geocoder = new Geocoder("BADKEY");

        $data  = $geocoder->convertToCoordinates('index.home.raft');
        $error = $geocoder->getError();<commit_msg>Fix to GeocoderTest for PHP 5/7 version mismatch<commit_after><?php

/**
 * w3w-php-wrapper - A PHP library to use the what3words RESTful API
 *
 * @author <NAME> <<EMAIL>>
 * @copyright 2016, 2017 what3words Ltd
 * @link http://developer.what3words.com
 * @license MIT
 * @version 3.3.0
 * @package What3words\Geocoder
 */

namespace What3words\Geocoder\Test;

use What3words\Geocoder\Geocoder;
use What3words\Geocoder\AutoSuggestOption;


class GeocoderTest extends \PHPUnit\Framework\TestCase
{
    protected $geocoder;

  protected function setUp()
    {
        $this->geocoder = new Geocoder(getenv('W3W_API_KEY'));
    }

    public function testBuildGeocoder()
    {
        $this->assertObjectHasAttribute('api_key', $this->geocoder);
    }

    public function testInvalidKey()
    {
        $geocoder = new Geocoder("BADKEY");

        $data  = $geocoder->convertToCoordinates('index.home.raft');
        $error = $geocoder->getError();
{'fraction_non_alphanumeric': 0.12748789671866595, 'fraction_numerical': 0.022592791823561054, 'mean_word_length': 3.5255474452554743, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, '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': '1514028', 'n_tokens_mistral': 651, 'n_tokens_neox': 616, 'n_words': 126}