Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ZF3] Fixed errors in user profile page #390

Merged
merged 28 commits into from
Jun 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7725585
[ZF3][Behat] integrated behat into YAWIK
kilip Jun 22, 2017
511b2cd
[ZF3][Behat] created travis configuration for behat
kilip Jun 22, 2017
d175426
[ZF3][Behat] fixed chromedriver links
kilip Jun 22, 2017
b81c2b4
[ZF3][Behat] added default behat configuration
kilip Jun 22, 2017
d780113
[ZF3][Behat] fixed travis php dev server command
kilip Jun 22, 2017
e26214d
[ZF3][Behat] added behat imgur and termbin logs
kilip Jun 22, 2017
12b8865
[ZF3][Behat] composer install with --dev option
kilip Jun 22, 2017
31d269a
[ZF3][Behat] added APPLICATION_ENV=development to travis testing envi…
kilip Jun 22, 2017
92c0f9c
[ZF3][Behat] removed Behat from ignored dir
kilip Jun 22, 2017
f9a67cd
[ZF3][Behat] added missing behat context and configuration files
kilip Jun 22, 2017
ea972cf
[ZF3][Behat] added yawik default configuration for travis
kilip Jun 22, 2017
ceaccc4
[ZF3][Behat] fixed termbin error log
kilip Jun 22, 2017
8c0db5b
[ZF3][Behat] improved behat contexts
kilip Jun 22, 2017
f094bef
[ZF3][Behat] improved behat contexts
kilip Jun 22, 2017
f5e78b7
[ZF3][Behat] fixed travis script
kilip Jun 22, 2017
bcae224
[ZF3][Behat] fixed built in php server command in travis
kilip Jun 22, 2017
c9abe31
[ZF3][Behat] fixed user context and travis script
kilip Jun 22, 2017
1072c87
[ZF3][Behat] fixed typo on travis script
kilip Jun 22, 2017
8301b2b
[Behat] added imgur-uploader script to upload failed behat tests scre…
kilip Jun 22, 2017
06b3faf
Merge remote-tracking branch 'upstream/feature/ZF3' into feature-behat
kilip Jun 22, 2017
b26220c
[ZF3][Behat] fixed imgur upload command
kilip Jun 22, 2017
b367fe3
[ZF3][Behat] fixed behat command, show progress only
kilip Jun 22, 2017
1682fbb
[ZF3][Auth] cleaned error when accessing user profile page
kilip Jun 23, 2017
3ba4f84
Merge branch 'feature/ZF3' of https://github.com/cross-solution/YAWIK…
kilip Jun 23, 2017
50a14b1
Merge branch 'feature-behat' into feature/ZF3
kilip Jun 23, 2017
2a516cb
[ZF3][Auth,Behat] fixed error in user profile pages, also added behat…
kilip Jun 23, 2017
8d468f4
[ZF3][Auth,Behat] fixed errors when linking facebook, linkedin profil…
kilip Jun 26, 2017
185fe83
[ZF3][Auth,Behat] prepared travis for social profile tests
kilip Jun 26, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ install:
- export PATH="$HOME/.composer/vendor/bin:$PATH"

before_script:
# copy default app config
- mkdir -p config/autoload
- mkdir -p build/behat
- cp .travis/yawik.config.global.php config/autoload
- cp .travis/module.auth.local.php config/autoload

# install Mongo extension
- sh -c "wget http://pecl.php.net/get/$PECLMONGO.tgz"
- sh -c "tar xfz $PECLMONGO.tgz"
Expand All @@ -30,15 +36,31 @@ before_script:
- phpenv config-add .travis/phpenv.ini
- ./install.sh -b .travis/build.properties.travis
- ./composer.phar self-update
- ./composer.phar install
- ./composer.phar install --dev

# setup display, behat, and selenium
- "sh -e /etc/init.d/xvfb start"
- "export DISPLAY=:99.0"
- "wget http://chromedriver.storage.googleapis.com/2.12/chromedriver_linux64.zip -O chromedriver.zip && unzip chromedriver.zip && sudo mv chromedriver /usr/bin"
- ./vendor/bin/selenium-server-standalone -Dwebdriver.chrome.driver=/usr/bin/chromedriver > /dev/null 2>&1 &
- sleep 5
- APPLICATION_ENV=development php -S localhost:8000 -t public public/index.php > /dev/null 2>&1 &
- sleep 3


script:
- ln -s ../test/build/logs build
- cd test
- ./phpunit --configuration $TRAVIS_BUILD_DIR/test/phpunit.xml.dist
- cd $TRAVIS_BUILD_DIR
- APPLICATION_ENV=development ./vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="@javascript && ~@todo"

after_script:
- cd $TRAVIS_BUILD_DIR
- "./vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles \"build/behat/*.log\""
- "./vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles \"log/*.log\""
- "./vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles \"log/tracy/*.*\""
- "IMGUR_CLIENT_ID=bec050c54e1bb52 ./bin/imgur-uploader.sh build/behat/*.png"
- ls -l test/build/logs
- php vendor/bin/coveralls -vvv
- wget https://scrutinizer-ci.com/ocular.phar
Expand Down
60 changes: 60 additions & 0 deletions .travis/module.auth.local.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php

$FACEBOOK_APP_ID = getenv('FACEBOOK_APP_ID');
$FACEBOOK_APP_SECRET = getenv('FACEBOOK_APP_SECRET');
$LINKEDIN_APP_ID = getenv('LINKEDIN_APP_ID');
$LINKEDIN_APP_SECRET = getenv('LINKEDIN_APP_SECRET');

return array(
'hybridauth' => array(
"Facebook" => array (
"enabled" => true,
"keys" => array ( "id" => $FACEBOOK_APP_ID, "secret" => $FACEBOOK_APP_SECRET ),
"scope" => "email, user_about_me, user_birthday, user_hometown, user_work_history, user_education_history",// optional
"display" => "popup"

),
"LinkedIn" => array (
"enabled" => true,
"keys" => array ( "id" => $LINKEDIN_APP_ID, "secret" => $LINKEDIN_APP_SECRET ),
"scope" => "r_basicprofile,r_emailaddress"
),
"XING" => array(
"enabled" => false,
'keys' => array ( "key" => '###XING APP KEY###', 'secret' => '### XING APP SECRET ###'),
"scope" => ''
),
"Github" => array(
"enabled" => false,
'keys' => array ( "id" => '###Your GitHub AppID ###', 'secret' => '###Your GitHub Secret###'),
"scope" => ''
),
"Google" => array(
// see http://hybridauth.sourceforge.net/userguide/IDProvider_info_Google.html
"enabled" => false,
'keys' => array ( "id" => '###Your Google Client-ID ###', 'secret' => '###Your GitHub Secret###'),
"scope" => "https://www.googleapis.com/auth/userinfo.profile ". // optional
"https://www.googleapis.com/auth/userinfo.email" , // optional
"access_type" => "offline", // optional
"approval_prompt" => "force", // optional
),



// "OpenID" => array(
// 'enabled' => true
// )
),

'Auth' => array(
'first_login' => array (
'role' => '%%role%%', // role set on the first login.
'auth_suffix' => '%%auth.suffix%%', // an auth suffix is needed, if you plan to add external apps.
),
// this allows an external application to use the YAWIK API
// applications[USERPOSTFIX] => AppKey
'external_applications' => array(
'%%external.app.prefix%%' => '%%external.app.key%%',
),
),
);
25 changes: 25 additions & 0 deletions .travis/yawik.config.global.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

return array(
'doctrine' =>
array(
'connection' =>
array(
'odm_default' =>
array(
'connectionString' => '',
),
),
'configuration' =>
array(
'odm_default' =>
array(
'default_db' => 'YAWIK',
),
),
),
'core_options' =>
array(
'system_message_email' => 'me@itstoni.com',
),
);
46 changes: 46 additions & 0 deletions behat.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This file is part of the YAWIK Project
# (c) 2013 - 2016 Cross Solution (http://cross-solution.de)

default:
formatters:
pretty:
verbose: true
paths: false
extensions:
Lakion\Behat\MinkDebugExtension:
directory: build/behat
clean_start: true
screenshot: true

Behat\MinkExtension:
files_path: "%paths.base%/module/Behat/resources/fixtures/"
base_url: "http://localhost:8000"
javascript_session: chrome
sessions:
chrome:
selenium2:
browser: chrome
capabilities:
browserName: chrome
browser: chrome
version: ""
chrome:
switches:
- "start-fullscreen"
- "start-maximized"
- "no-sandbox"
firefox:
selenium2:
browser: firefox
show_auto: false

gherkin:
filters:
tags: "~@todo && ~@cli" # CLI is excluded as it registers an error handler that mutes fatal errors

suites:
user:
contexts:
- Behat\MinkExtension\Context\MinkContext
- Yawik\Behat\CoreContext
- Yawik\Behat\UserContext
118 changes: 118 additions & 0 deletions bin/imgur-uploader.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#!/bin/bash

# Imgur script by Bart Nagel <bart@tremby.net>
# Improvements by Tino Sino <robottinosino@gmail.com>
# Version 6 or more
# I release this into the public domain. Do with it what you will.
# The latest version can be found at https://github.com/tremby/imgur.sh

# API Key provided by Bart;
# replace with your own or specify yours as IMGUR_CLIENT_ID envionment variable
# to avoid limits
default_client_id=c9a6efb3d7932fd
client_id="${IMGUR_CLIENT_ID:=$default_client_id}"

# Function to output usage instructions
function usage {
echo "Usage: $(basename $0) [<filename|URL> [...]]" >&2
echo
echo "Upload images to imgur and output their new URLs to stdout. Each one's" >&2
echo "delete page is output to stderr between the view URLs." >&2
echo
echo "A filename can be - to read from stdin. If no filename is given, stdin is read." >&2
echo
echo "If xsel, xclip, or pbcopy is available, the URLs are put on the X selection for" >&2
echo "easy pasting." >&2
}

# Function to upload a path
# First argument should be a content spec understood by curl's -F option
function upload {
curl -s -H "Authorization: Client-ID $client_id" -H "Expect: " -F "image=$1" https://api.imgur.com/3/image.xml
# The "Expect: " header is to get around a problem when using this through
# the Squid proxy. Not sure if it's a Squid bug or what.
}

# Check arguments
if [ "$1" == "-h" -o "$1" == "--help" ]; then
usage
exit 0
elif [ $# -eq 0 ]; then
echo "No file specified; reading from stdin" >&2
exec "$0" -
fi

# Check curl is available
type curl &>/dev/null || {
echo "Couldn't find curl, which is required." >&2
exit 17
}

clip=""
errors=false

# Loop through arguments
while [ $# -gt 0 ]; do
file="$1"
shift

# Upload the image
if [[ "$file" =~ ^https?:// ]]; then
# URL -> imgur
response=$(upload "$file") 2>/dev/null
else
# File -> imgur
# Check file exists
if [ "$file" != "-" -a ! -f "$file" ]; then
echo "File '$file' doesn't exist; skipping" >&2
errors=true
continue
fi
response=$(upload "@$file") 2>/dev/null
fi

if [ $? -ne 0 ]; then
echo "Upload failed" >&2
errors=true
continue
elif echo "$response" | grep -q 'success="0"'; then
echo "Error message from imgur:" >&2
msg="${response##*<error>}"
echo "${msg%%</error>*}" >&2
errors=true
continue
fi

# Parse the response and output our stuff
url="${response##*<link>}"
url="${url%%</link>*}"
delete_hash="${response##*<deletehash>}"
delete_hash="${delete_hash%%</deletehash>*}"
echo $url | sed 's/^http:/https:/'
echo "Delete page: https://imgur.com/delete/$delete_hash" >&2

# Append the URL to a string so we can put them all on the clipboard later
clip+="$url"
if [ $# -gt 0 ]; then
clip+=$'\n'
fi
done

# Put the URLs on the clipboard if we can
if type pbcopy &>/dev/null; then
echo -n "$clip" | pbcopy
elif [ $DISPLAY ]; then
if type xsel &>/dev/null; then
echo -n "$clip" | xsel
elif type xclip &>/dev/null; then
echo -n "$clip" | xclip
else
echo "Haven't copied to the clipboard: no xsel or xclip" >&2
fi
else
echo "Haven't copied to the clipboard: no \$DISPLAY or pbcopy" >&2
fi

if $errors; then
exit 1
fi
29 changes: 22 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"support": {
"email": "contact@yawik.org",
"docs": "http://yawik.readthedocs.org/en/latest/",
"forum": "https://groups.google.com/forum/#!forum/yawik",
"issues": "https://github.com/cross-solution/YAWIK/issues"
"forum": "https://groups.google.com/forum/#!forum/yawik",
"issues": "https://github.com/cross-solution/YAWIK/issues"
},
"license": "MIT",
"keywords": [
Expand All @@ -46,7 +46,7 @@
"zendframework/zend-mail": "^2.7",
"zendframework/zend-json": "^3.0",
"doctrine/doctrine-mongo-odm-module": "*",
"hybridauth/hybridauth": "2.6.*",
"hybridauth/hybridauth": "^2.9",
"mpdf/mpdf": "5.7.*",
"components/jquery": "<3",
"tinymce/tinymce": "*",
Expand All @@ -59,18 +59,33 @@
"zendframework/zend-feed": "^2.8",
"imagine/imagine": "^0.6.3",
"zendframework/zendservice-recaptcha": "^3.0",
"zendframework/zend-log": "^2.9",
"phpunit/phpunit": "~5.7"
"zendframework/zend-log": "^2.9"
},
"require-dev": {
"cbleek/pecl-solr-hint": "dev-master",
"satooshi/php-coveralls": "^1.0",
"zendframework/zend-component-installer": "^0.7.0",
"zendframework/zend-test": "^3.1"
"zendframework/zend-test": "^3.1",
"phpunit/phpunit": "5.6.x",
"behat/behat": "^3.2",
"behat/mink": "^1.7",
"behat/mink-browserkit-driver": "^1.3",
"behat/mink-extension": "^2.2",
"behat/mink-selenium2-driver": "^1.3",
"lakion/mink-debug-extension": "^1.2.3",
"se/selenium-server-standalone": "^2.52",
"friends-of-behat/context-service-extension": "^0.3.0",
"friends-of-behat/cross-container-extension": "^0.3.0",
"friends-of-behat/service-container-extension": "^0.3.0"
},
"scripts": {
"post-install-cmd": [
"./install.sh"
]
}
},
"autoload": {
"psr-4": {
"Yawik\\Behat\\": "module/Behat/src"
}
}
}
Loading