From 67bc7007aa58cbb44801f3df1d1f98ae3f8e2c64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Blanco?= Date: Fri, 14 Jul 2017 16:05:46 +0100 Subject: [PATCH 01/13] Support new lines for book/chapter descriptions Avoid ignoring new lines when renderring the book/chapter descriptions on their respective detailed views. --- resources/views/books/show.blade.php | 6 +++--- resources/views/chapters/show.blade.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/views/books/show.blade.php b/resources/views/books/show.blade.php index ddbe7a0a4..d5832b708 100644 --- a/resources/views/books/show.blade.php +++ b/resources/views/books/show.blade.php @@ -56,7 +56,7 @@

{{$book->name}}

-

{{$book->description}}

+

{!! nl2br($book->description) !!}


@@ -118,7 +118,7 @@
- +

{{ trans('entities.recent_activity') }}

@include('partials/activity-list', ['activity' => Activity::entityActivity($book, 20, 0)]) @@ -127,4 +127,4 @@
-@stop \ No newline at end of file +@stop diff --git a/resources/views/chapters/show.blade.php b/resources/views/chapters/show.blade.php index d4126cbcc..9b549cfbd 100644 --- a/resources/views/chapters/show.blade.php +++ b/resources/views/chapters/show.blade.php @@ -52,7 +52,7 @@

{{ $chapter->name }}

-

{{ $chapter->description }}

+

{!! nl2br($chapter->description) !!}

@if(count($pages) > 0)
From 711dcb4a4834a562bcdb36c7dac17964e93f38a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Blanco?= Date: Mon, 17 Jul 2017 13:29:29 +0100 Subject: [PATCH 02/13] Update travis.yml to try and solve the test issue around LDAP. --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 909e3e1f4..c5199b65f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,9 @@ cache: directories: - $HOME/.composer/cache +before_install: + - echo "extension=ldap.so" >> php --ini | grep "Loaded Configuration" | sed -e "s|.:\s||" + before_script: - mysql -u root -e 'create database `bookstack-test`;' - mysql -u root -e "CREATE USER 'bookstack-test'@'localhost' IDENTIFIED BY 'bookstack-test';" @@ -25,4 +28,4 @@ after_failure: - cat storage/logs/laravel.log script: - - phpunit \ No newline at end of file + - phpunit From 265ed34ffd49f199fe78e571a242eae39a4ea7bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Blanco?= Date: Mon, 17 Jul 2017 13:34:19 +0100 Subject: [PATCH 03/13] Update travis.yml to try and solve the test issue around LDAP. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c5199b65f..97895fee8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ cache: - $HOME/.composer/cache before_install: - - echo "extension=ldap.so" >> php --ini | grep "Loaded Configuration" | sed -e "s|.:\s||" + - echo "extension = ldap.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini before_script: - mysql -u root -e 'create database `bookstack-test`;' From ae2ec43a826c92d96ae33388eba3d1599dc598e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Blanco?= Date: Mon, 17 Jul 2017 13:35:38 +0100 Subject: [PATCH 04/13] Avoid having to wait until all tests are processed to exit upon error/failure. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 97895fee8..c79775caf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,4 +28,4 @@ after_failure: - cat storage/logs/laravel.log script: - - phpunit + - phpunit --stop-on-error --stop-on-failure From 0d98b4ce5e4176ef4f31a5374964c054c48048db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Blanco?= Date: Mon, 17 Jul 2017 13:37:15 +0100 Subject: [PATCH 05/13] Trying to make the tests green. --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index c79775caf..edc5732f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,9 +8,6 @@ cache: directories: - $HOME/.composer/cache -before_install: - - echo "extension = ldap.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - before_script: - mysql -u root -e 'create database `bookstack-test`;' - mysql -u root -e "CREATE USER 'bookstack-test'@'localhost' IDENTIFIED BY 'bookstack-test';" From 5eeed03dcded3d024ac719599da250444bb87ac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Blanco?= Date: Mon, 17 Jul 2017 13:53:02 +0100 Subject: [PATCH 06/13] Trying to make the tests green. --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index edc5732f6..4bd36f568 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,11 @@ language: php php: - 7.0 +before_install: + - pecl install ldap + - echo "extension=ldap.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini + - php -i "(command-line 'phpinfo()')" | grep ldap + cache: directories: - $HOME/.composer/cache From afc56c12fe02e4a1947b22b1858f6b2662e9bd80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Blanco?= Date: Mon, 17 Jul 2017 14:01:10 +0100 Subject: [PATCH 07/13] Trying to make the tests green. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4bd36f568..a4116a317 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ php: - 7.0 before_install: - - pecl install ldap + - sudo apt-get install php7.0-ldap - echo "extension=ldap.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - php -i "(command-line 'phpinfo()')" | grep ldap From 3b771f2976e3272e77faaf1f5aed06d66aefd48e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Blanco?= Date: Mon, 17 Jul 2017 14:03:31 +0100 Subject: [PATCH 08/13] Trying to make the tests green. --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a4116a317..f1495b46e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,12 @@ language: php php: - 7.0 +addons: + apt: + packages: + - php7.0-ldap + before_install: - - sudo apt-get install php7.0-ldap - echo "extension=ldap.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - php -i "(command-line 'phpinfo()')" | grep ldap From 6ef522df7ec8b43f484461e7690b08196d3585c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Blanco?= Date: Mon, 17 Jul 2017 14:05:41 +0100 Subject: [PATCH 09/13] Trying to make the tests green. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f1495b46e..054bc8b7d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ php: addons: apt: packages: - - php7.0-ldap + - php-ldap before_install: - echo "extension=ldap.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini From 684c20c4ea186876afb4aa84115773d032d7063b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Blanco?= Date: Mon, 17 Jul 2017 14:09:21 +0100 Subject: [PATCH 10/13] Trying to make the tests green. --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 054bc8b7d..4613c64ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,8 @@ php: addons: apt: packages: - - php-ldap + - ldap-utils + - slapd before_install: - echo "extension=ldap.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini From 3407900abb7d1fe40551881ecf901d6e69c0d5a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Blanco?= Date: Mon, 17 Jul 2017 14:18:03 +0100 Subject: [PATCH 11/13] Trying to make the tests green. --- .travis.yml | 1 - tests/Auth/LdapTest.php | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4613c64ef..f03865201 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,6 @@ addons: before_install: - echo "extension=ldap.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - php -i "(command-line 'phpinfo()')" | grep ldap cache: directories: diff --git a/tests/Auth/LdapTest.php b/tests/Auth/LdapTest.php index 681ead91c..f66d357e3 100644 --- a/tests/Auth/LdapTest.php +++ b/tests/Auth/LdapTest.php @@ -21,6 +21,7 @@ class LdapTest extends BrowserKitTest { $this->mockLdap->shouldReceive('connect')->once()->andReturn($this->resourceId); $this->mockLdap->shouldReceive('setVersion')->once(); + $this->mockLdap->shouldReceive('setOption'); $this->mockLdap->shouldReceive('searchAndGetEntries')->times(4) ->with($this->resourceId, config('services.ldap.base_dn'), \Mockery::type('string'), \Mockery::type('array')) ->andReturn(['count' => 1, 0 => [ @@ -129,4 +130,4 @@ class LdapTest extends BrowserKitTest ->dontSee('External Authentication'); } -} \ No newline at end of file +} From f38bc75ab4f1d6980ecff7e2a1eb70eda8b42565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Blanco?= Date: Mon, 17 Jul 2017 14:21:41 +0100 Subject: [PATCH 12/13] Trying to make the tests green. --- tests/Auth/LdapTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Auth/LdapTest.php b/tests/Auth/LdapTest.php index f66d357e3..573de4c43 100644 --- a/tests/Auth/LdapTest.php +++ b/tests/Auth/LdapTest.php @@ -21,7 +21,7 @@ class LdapTest extends BrowserKitTest { $this->mockLdap->shouldReceive('connect')->once()->andReturn($this->resourceId); $this->mockLdap->shouldReceive('setVersion')->once(); - $this->mockLdap->shouldReceive('setOption'); + $this->mockLdap->shouldReceive('setOption')->times(4); $this->mockLdap->shouldReceive('searchAndGetEntries')->times(4) ->with($this->resourceId, config('services.ldap.base_dn'), \Mockery::type('string'), \Mockery::type('array')) ->andReturn(['count' => 1, 0 => [ @@ -50,6 +50,7 @@ class LdapTest extends BrowserKitTest $this->mockLdap->shouldReceive('connect')->once()->andReturn($this->resourceId); $this->mockLdap->shouldReceive('setVersion')->once(); $ldapDn = 'cn=test-user,dc=test' . config('services.ldap.base_dn'); + $this->mockLdap->shouldReceive('setOption')->times(2); $this->mockLdap->shouldReceive('searchAndGetEntries')->times(2) ->with($this->resourceId, config('services.ldap.base_dn'), \Mockery::type('string'), \Mockery::type('array')) ->andReturn(['count' => 1, 0 => [ From 245294fbc55d0a2ecc765620758763b2f8f72998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Blanco?= Date: Mon, 17 Jul 2017 14:42:08 +0100 Subject: [PATCH 13/13] Trying to make the tests green. --- tests/Auth/LdapTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Auth/LdapTest.php b/tests/Auth/LdapTest.php index 573de4c43..f6e8336e6 100644 --- a/tests/Auth/LdapTest.php +++ b/tests/Auth/LdapTest.php @@ -74,6 +74,7 @@ class LdapTest extends BrowserKitTest { $this->mockLdap->shouldReceive('connect')->once()->andReturn($this->resourceId); $this->mockLdap->shouldReceive('setVersion')->once(); + $this->mockLdap->shouldReceive('setOption')->times(2); $this->mockLdap->shouldReceive('searchAndGetEntries')->times(2) ->with($this->resourceId, config('services.ldap.base_dn'), \Mockery::type('string'), \Mockery::type('array')) ->andReturn(['count' => 1, 0 => [