From b63908435a60d8009c9e826c4e85f29e8b9035ac Mon Sep 17 00:00:00 2001 From: fokosun Date: Tue, 19 Sep 2023 13:47:08 -0400 Subject: [PATCH] small fix --- .travis.yml | 14 --------- Dockerfile | 6 ++-- Vagrantfile | 58 ------------------------------------ app/Services/UserService.php | 2 +- tests/Feature/UserTest.php | 48 ++++++++++++++++++----------- 5 files changed, 33 insertions(+), 95 deletions(-) delete mode 100755 .travis.yml delete mode 100755 Vagrantfile diff --git a/.travis.yml b/.travis.yml deleted file mode 100755 index 1cd305ba..00000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: php - -install: - - curl -s http://getcomposer.org/installer | php - - php composer.phar install --dev --no-interaction - -script: - - mkdir -p build/logs - - php vendor/bin/phpunit -c phpunit.xml.dist - -after_success: - - travis_retry php vendor/bin/coveralls - - travis_retry php vendor/bin/coveralls -v - diff --git a/Dockerfile b/Dockerfile index 29b61cf4..28ecb93b 100755 --- a/Dockerfile +++ b/Dockerfile @@ -26,8 +26,9 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/* RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd RUN mkdir -p /var/www -WORKDIR /var/www COPY ./ /var/www/ +# Set working directory +WORKDIR /var/www # Get latest Composer COPY --from=composer:latest /usr/bin/composer /usr/bin/composer @@ -37,9 +38,6 @@ RUN useradd -G www-data,root -u 1000 -d /home/dev dev RUN mkdir -p /home/dev/.composer && \ chown -R dev:dev /home/dev -# Set working directory -WORKDIR /var/www - USER $user RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/php.ini diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100755 index d402e6ef..00000000 --- a/Vagrantfile +++ /dev/null @@ -1,58 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -require 'json' -require 'yaml' - -VAGRANTFILE_API_VERSION ||= "2" -confDir = $confDir ||= File.expand_path(File.dirname(__FILE__)) - -homesteadYamlPath = confDir + "/Homestead.yaml" -homesteadJsonPath = confDir + "/Homestead.json" -afterScriptPath = confDir + "/after.sh" -customizationScriptPath = confDir + "/user-customizations.sh" -aliasesPath = confDir + "/aliases" - -require File.expand_path(File.dirname(__FILE__) + '/scripts/homestead.rb') - -Vagrant.require_version '>= 2.2.4' - -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - if File.exist? aliasesPath then - config.vm.provision "file", source: aliasesPath, destination: "/tmp/bash_aliases" - config.vm.provision "shell" do |s| - s.inline = "awk '{ sub(\"\r$\", \"\"); print }' /tmp/bash_aliases > /home/vagrant/.bash_aliases && chown vagrant:vagrant /home/vagrant/.bash_aliases" - end - end - - if File.exist? homesteadYamlPath then - settings = YAML::load(File.read(homesteadYamlPath)) - elsif File.exist? homesteadJsonPath then - settings = JSON::parse(File.read(homesteadJsonPath)) - else - abort "Homestead settings file not found in #{confDir}" - end - - Homestead.configure(config, settings) - - if File.exist? afterScriptPath then - config.vm.provision "shell", path: afterScriptPath, privileged: false, keep_color: true - end - - if File.exist? customizationScriptPath then - config.vm.provision "shell", path: customizationScriptPath, privileged: false, keep_color: true - end - - if Vagrant.has_plugin?('vagrant-hostsupdater') - config.hostsupdater.remove_on_suspend = false - config.hostsupdater.aliases = settings['sites'].map { |site| site['map'] } - elsif Vagrant.has_plugin?('vagrant-hostmanager') - config.hostmanager.enabled = true - config.hostmanager.manage_host = true - config.hostmanager.aliases = settings['sites'].map { |site| site['map'] } - end - - if Vagrant.has_plugin?('vagrant-notify-forwarder') - config.notify_forwarder.enable = true - end -end diff --git a/app/Services/UserService.php b/app/Services/UserService.php index ae3f2051..ce332e4d 100755 --- a/app/Services/UserService.php +++ b/app/Services/UserService.php @@ -26,7 +26,7 @@ public function __construct() */ public function index() { - return User::with('cookbooks', 'recipes', 'contact')->get(); + return User::paginate(15); } /** diff --git a/tests/Feature/UserTest.php b/tests/Feature/UserTest.php index e19cd6b0..3ade0d12 100755 --- a/tests/Feature/UserTest.php +++ b/tests/Feature/UserTest.php @@ -230,24 +230,36 @@ public function it_can_retrieve_all_users() ->assertStatus(200) ->assertJsonStructure([ 'data' => [ - [ - 'name', - 'cookbooks', - 'recipes', - 'contact', - 'contributions', - 'email', - 'following', - 'followers', - 'created_at', - 'updated_at', - 'name_slug', - 'pronouns', - 'avatar', - 'expertise_level', - 'about', - 'can_take_orders', - 'email_verified' + 'current_page', + 'first_page_url', + 'from', + 'last_page', + 'last_page_url', + 'links', + 'next_page_url', + 'path', + 'per_page', + 'prev_page_url', + 'to', + 'total', + 'data' => [ + [ + 'name', + 'contact_detail', + 'contributions', + 'email', + 'following', + 'followers', + 'created_at', + 'updated_at', + 'name_slug', + 'pronouns', + 'avatar', + 'expertise_level', + 'about', + 'can_take_orders', + 'email_verified' + ] ] ] ]);