<commit_before>$: << 'cf_spec'
require 'cf_spec_helper'

describe 'CF PHP Buildpack' do
  subject(:app) { Machete.deploy_app(app_name, {env: {'COMPOSER_GITHUB_OAUTH_TOKEN' => ENV['COMPOSER_GITHUB_OAUTH_TOKEN']}}) }
  let(:browser) { Machete::Browser.new(app) }

  after do
    Machete::CF::DeleteApp.new.execute(app)
  end

  context 'deploying a basic PHP app' do
    let(:app_name) { 'php_app' }

    specify do
      expect(app).to be_running

      expect(app).to have_logged '-------> Buildpack version 3'
      expect(app).to have_logged 'Installing PHP'
      expect(app).to have_logged 'PHP 5.5'

      browser.visit_path('/')
      expect(browser).to have_body('PHP Version')

      assert_offline_mode_has_no_internet_traffic
    end
  end
end
<commit_msg>Add integration test to see that PHP version is not exposed in app page header<commit_after>$: << 'cf_spec'
require 'cf_spec_helper'

describe 'CF PHP Buildpack' do
  subject(:app) { Machete.deploy_app(app_name, {env: {'COMPOSER_GITHUB_OAUTH_TOKEN' => ENV['COMPOSER_GITHUB_OAUTH_TOKEN']}}) }
  let(:browser) { Machete::Browser.new(app) }

  after do
    Machete::CF::DeleteApp.new.execute(app)
  end

  context 'deploying a basic PHP app' do
    let(:app_name) { 'php_app' }

    specify do
      expect(app).to be_running

      expect(app).to have_logged '-------> Buildpack version 3'
      expect(app).to have_logged 'Installing PHP'
      expect(app).to have_logged 'PHP 5.5'

      browser.visit_path('/')
      expect(browser).to have_body 'PHP Version'
      expect(browser).not_to have_header 'X-Powered-By'

      assert_offline_mode_has_no_internet_traffic
    end
  end
end

{'fraction_non_alphanumeric': 0.12651331719128328, 'fraction_numerical': 0.0036319612590799033, 'mean_word_length': 3.777456647398844, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3860339', 'n_tokens_mistral': 605, 'n_tokens_neox': 588, 'n_words': 126}