<commit_before>Code.require_file "../../support/http_client.exs", __DIR__

defmodule Phoenix.Integration.LongPollChannelsTest do
  use ExUnit.Case
  import ExUnit.CaptureLog

  alias Phoenix.Integration.HTTPClient
  alias Phoenix.Socket.{Broadcast, Message, V1, V2}
  alias Phoenix.PubSub.Local
  alias __MODULE__.Endpoint

  @moduletag :capture_log
  @port 5808
  @pool_size 1

  Application.put_env(:phoenix, Endpoint, [
    https: false,
    http: [port: @port],
    secret_key_base: String.duplicate("<KEY>", 8),
    server: true,
    pubsub: [adapter: Phoenix.PubSub.PG2, name: __MODULE__, pool_size: @pool_size]
  ])

  defmodule RoomChannel do
    use Phoenix.Channel, log_join: :info, log_handle_in: :info

    intercept ["new_msg"]

    def join(topic, message, socket) do
      Process.register(self(), String.to_atom(topic))
      send(self(), {:after_join, message})
      {:ok, socket}
    end

    def handle_info({:after_join, message}, socket) do
      broadcast socket, "user_entered", %{user: message["user"]}
      push socket, "joined", Map.merge(%{status: "connected"}, socket.assigns)
      {:noreply, socket}<commit_msg>Remove unused alias Local from long_poll_channels_test (#3030)<commit_after>Code.require_file "../../support/http_client.exs", __DIR__

defmodule Phoenix.Integration.LongPollChannelsTest do
  use ExUnit.Case
  import ExUnit.CaptureLog

  alias Phoenix.Integration.HTTPClient
  alias Phoenix.Socket.{Broadcast, Message, V1, V2}
  alias __MODULE__.Endpoint

  @moduletag :capture_log
  @port 5808
  @pool_size 1

  Application.put_env(:phoenix, Endpoint, [
    https: false,
    http: [port: @port],
    secret_key_base: String.duplicate("<KEY>", 8),
    server: true,
    pubsub: [adapter: Phoenix.PubSub.PG2, name: __MODULE__, pool_size: @pool_size]
  ])

  defmodule RoomChannel do
    use Phoenix.Channel, log_join: :info, log_handle_in: :info

    intercept ["new_msg"]

    def join(topic, message, socket) do
      Process.register(self(), String.to_atom(topic))
      send(self(), {:after_join, message})
      {:ok, socket}
    end

    def handle_info({:after_join, message}, socket) do
      broadcast socket, "user_entered", %{user: message["user"]}
      push socket, "joined", Map.merge(%{status: "connected"}, socket.assigns)
      {:noreply, socket}
{'fraction_non_alphanumeric': 0.12966175195143104, 'fraction_numerical': 0.009540329575021683, 'mean_word_length': 4.0927152317880795, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2886481', 'n_tokens_mistral': 784, 'n_tokens_neox': 750, 'n_words': 179}