<commit_before>System.put_env("ENDPOINT_TEST_HOST", "host.com")

defmodule Phoenix.Transports.TransportTest do
  use ExUnit.Case, async: true
  use RouterHelper

  alias Phoenix.Socket.Transport
  alias Phoenix.Socket.Message

  Application.put_env :phoenix, __MODULE__.Endpoint, 
    force_ssl: [],
    url: [host: {:system, "ENDPOINT_TEST_HOST"}],
    check_origin: ["//endpoint.com"]

  defmodule Endpoint do
    use Phoenix.Endpoint, otp_app: :phoenix
  end

  setup_all do
    Endpoint.start_link
    :ok
  end

  setup do
    Logger.disable(self())
  end

  ## on_exit_message

  test "on_exit_message/3" do
    assert Transport.on_exit_message("foo", "1", :normal) ==
           %Message{ref: "1", event: "phx_close", payload: %{}, topic: "foo"}<commit_msg>Fix test race making travis unhappy<commit_after>System.put_env("TRANSPORT_TEST_HOST", "host.com")

defmodule Phoenix.Transports.TransportTest do
  use ExUnit.Case, async: true
  use RouterHelper

  alias Phoenix.Socket.Transport
  alias Phoenix.Socket.Message

  Application.put_env :phoenix, __MODULE__.Endpoint,
    force_ssl: [],
    url: [host: {:system, "TRANSPORT_TEST_HOST"}],
    check_origin: ["//endpoint.com"]

  defmodule Endpoint do
    use Phoenix.Endpoint, otp_app: :phoenix
  end

  setup_all do
    Endpoint.start_link
    :ok
  end

  setup do
    Logger.disable(self())
  end

  ## on_exit_message

  test "on_exit_message/3" do
    assert Transport.on_exit_message("foo", "1", :normal) ==
           %Message{ref: "1", event: "phx_close", payload: %{}, topic: "foo"}
{'fraction_non_alphanumeric': 0.12379110251450677, 'fraction_numerical': 0.0038684719535783366, 'mean_word_length': 3.865203761755486, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3006187', 'n_tokens_mistral': 534, 'n_tokens_neox': 518, 'n_words': 118}