<commit_before><?php
use PHPUnit\Framework\TestCase;
require_once 'class/promises/websitehandler.interface.php';

/**
 * Handle the Metrolink website
 **/
class WebsiteHandlerStub implements WebsiteHandlerInterface
{
    /**
     * @var string API url
     */
    private $url;

    /**
     * WebsiteHandler constructor.
     *
     * @param $url string API url
     */
    public function __construct($url)
    {
        $this->url = $url;
    }

    public function getMetrolinkStatus()
    {
        switch ($this->url) {
            case 'MINOR_DELAYS':
                return json_decode('
                    {
                        "retrievalDate": "22:32:30",
                        "items": 
                        [
                            {
                                "detail": "<p>Due to an act of vandalism we are currently experiencing minor delays on the East Didsbury line.</p><p>Services travelling in both directions between East Didsbury and Deansgate-Castlefield are affected.</p><p>This is due to earlier Anti-social behaviour at East Didsbury.</p><p>Metrolink apologises for any inconvenience this may cause.</p>",
                                "id": 4,
                                "name": "East Didsbury",
                                "severity": "warning",
                                "status": "Minor delays"
                            },
                            {
                                "detail": "<p>Due to an act of vandalism we are currently experiencing minor delays on the Rochdale via Oldham line.</p><p>Services travelling in both directions between Victoria and Rochdale Town Centre are affected.</p><p>Metrolink apologises for any inconvenience this may cause.</p>",
                                "id": 8,
                                "name": "Rochdale via Oldham",
                                "severity": "warning",
                                "status": "Minor delays"
                            },
                            {
                                "name": "Other lines",
                                "severity": "success",
                                "status": "Good service"
                            }
                        ]
                    }
                ');
            case 'GOOD_SERVICE':
                return json_decode('
                    {
                        "retrievalDate": "22:32:30",
                        "items": 
                        [
                            {
                                "name": "Other lines",
                                "severity": "success",
                                "status": "Good service"
                            }<commit_msg>Update unit test stub to match exactly what the API output says.<commit_after><?php
use PHPUnit\Framework\TestCase;
require_once 'class/promises/websitehandler.interface.php';

/**
 * Handle the Metrolink website
 **/
class WebsiteHandlerStub implements WebsiteHandlerInterface
{
    /**
     * @var string API url
     */
    private $url;

    /**
     * WebsiteHandler constructor.
     *
     * @param $url string API url
     */
    public function __construct($url)
    {
        $this->url = $url;
    }

    public function getMetrolinkStatus()
    {
        switch ($this->url) {
            case 'MINOR_DELAYS':
                return json_decode('
                    {
                        "retrievalDate": "22:32:30",
                        "items": 
                        [
                            {
                                "detail": "<p>Due to an act of vandalism we are currently experiencing minor delays on the East Didsbury line.</p><p>Services travelling in both directions between East Didsbury and Deansgate-Castlefield are affected.</p><p>This is due to earlier Anti-social behaviour at East Didsbury.</p><p>Metrolink apologises for any inconvenience this may cause.</p>",
                                "id": 4,
                                "name": "East Didsbury",
                                "severity": "warning",
                                "status": "Minor delays"
                            },
                            {
                                "detail": "<p>Due to an act of vandalism we are currently experiencing minor delays on the Rochdale via Oldham line.</p><p>Services travelling in both directions between Victoria and Rochdale Town Centre are affected.</p><p>Metrolink apologises for any inconvenience this may cause.</p>",
                                "id": 8,
                                "name": "Rochdale via Oldham",
                                "severity": "warning",
                                "status": "Minor delays"
                            },
                            {
                                "name": "Other lines",
                                "severity": "success",
                                "status": "Good service"
                            }
                        ]
                    }
                ');
            case 'GOOD_SERVICE':
                return json_decode('
                    {
                        "retrievalDate": "22:32:30",
                        "items": 
                        [
                            {
                                "name": "<NAME>",
                                "severity": "success",
                                "status": "Good service"
                            }
{'fraction_non_alphanumeric': 0.08996728462377317, 'fraction_numerical': 0.005089058524173028, 'mean_word_length': 1.0246504782928625, 'pattern_counts': {'":': 40, '<': 34, '<?xml version=': 0, '>': 36, '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': '6632834', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1191, 'n_words': 350}