Skip to content

Commit dbdc96d

Browse files
committed
ISSUE-337: phpdoc
1 parent 43fb174 commit dbdc96d

File tree

3 files changed

+24
-51
lines changed

3 files changed

+24
-51
lines changed

.github/workflows/core-docs.yml

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,19 @@ jobs:
66
runs-on: ubuntu-20.04
77
steps:
88
- name: Checkout
9-
uses: actions/checkout@v2
9+
uses: actions/checkout@v3
1010
- name: Setup PHP, with composer and extensions
11-
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
11+
uses: shivammathur/setup-php@v2
1212
with:
1313
php-version: 8.1
1414
extensions: mbstring, dom, fileinfo, mysql
1515
- name: Get composer cache directory
1616
id: composer-cache
17-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
17+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_ENV
1818
- name: Cache composer dependencies
19-
uses: actions/cache@v2
19+
uses: actions/cache@v3
2020
with:
21-
path: ${{ steps.composer-cache.outputs.dir }}
22-
# Use composer.json for key, if composer.lock is not committed.
23-
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
21+
path: ${{ env.dir }}
2422
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
2523
restore-keys: ${{ runner.os }}-composer-
2624
- name: Install current dependencies from composer.lock
@@ -34,48 +32,54 @@ jobs:
3432
run: phpDocumentor --version
3533
- name: Generate documentation
3634
run: composer run-php-documentor
37-
- name: zip phpdocumentor dir
35+
- name: Zip phpDocumentor directory
3836
run: zip -r phpdocumentor.zip docs/phpdocumentor
3937
- name: Upload generated doc files
40-
uses: actions/upload-artifact@v2
38+
uses: actions/upload-artifact@v4
4139
with:
4240
name: doc-files
4341
path: phpdocumentor.zip
4442
deploy-docs:
45-
name: Deploy Core Docs.
43+
name: Deploy Core Docs
4644
runs-on: ubuntu-20.04
4745
needs: make-restapi-docs
4846
steps:
4947
- name: Checkout phplist/core-docs
50-
uses: actions/checkout@v2
48+
uses: actions/checkout@v3
5149
with:
5250
repository: phpList/core-docs
5351
fetch-depth: 0
5452
token: ${{ secrets.PUSH_CORE_DOCS }}
5553
- name: Restore REST API Spec
56-
uses: actions/download-artifact@v2
54+
uses: actions/download-artifact@v4
5755
with:
5856
name: doc-files
59-
- name: unzip phpdocumentor
57+
- name: Unzip phpDocumentor
6058
run: |
6159
unzip phpdocumentor.zip
6260
rm phpdocumentor.zip
6361
- name: List Files
6462
run: ls
65-
- name: Sync old files with newly generated ones.
63+
- name: Sync old files with newly generated ones
6664
run: rsync -av docs/phpdocumentor/* .
67-
- name: Removed temp dirs
65+
- name: Remove temporary directories
6866
run: rm -rf docs
69-
- name: Check if updates/changes.
67+
- name: Check if updates/changes
7068
run: git status --porcelain > repo-changes.txt
7169
- name: Check changes file
7270
run: cat repo-changes.txt
73-
- name: Verify updates.
71+
- name: Verify updates
7472
id: allow-deploy
7573
run: |
76-
if [ -s repo-changes.txt ]; then echo "Updates made to documentation"; echo '::set-output name=DEPLOY::true'; else echo "No updates made to documentation deployment would be skipped."; echo '::set-output name=DEPLOY::false'; fi
77-
- name: Commit changes and deply
78-
if: ${{ steps.allow-deploy.outputs.DEPLOY == 'true' }}
74+
if [ -s repo-changes.txt ]; then
75+
echo "Updates made to documentation";
76+
echo 'DEPLOY=true' >> $GITHUB_ENV;
77+
else
78+
echo "No updates made to documentation. Deployment would be skipped.";
79+
echo 'DEPLOY=false' >> $GITHUB_ENV;
80+
fi
81+
- name: Commit changes and deploy
82+
if: ${{ env.DEPLOY == 'true' }}
7983
run: |
8084
rm repo-changes.txt
8185
git config user.name "github-actions"

tests/Integration/Domain/Repository/Messaging/SubscriberListRepositoryTest.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,6 @@ public function testFindReadsModelFromDatabase()
8282
self::assertSame($category, $model->getCategory());
8383
}
8484

85-
public function testCreatesOwnerAssociationAsProxy()
86-
{
87-
$this->loadFixtures([SubscriberListFixture::class, AdministratorFixture::class]);
88-
89-
$subscriberListId = 1;
90-
$ownerId = 1;
91-
/** @var SubscriberList $model */
92-
$model = $this->subscriberListRepository->find($subscriberListId);
93-
$owner = $model->getOwner();
94-
95-
self::assertInstanceOf(Administrator::class, $owner);
96-
// self::assertInstanceOf(Proxy::class, $owner); todo: check proxy
97-
self::assertSame($ownerId, $owner->getId());
98-
}
99-
10085
public function testCreationDateOfNewModelIsSetToNowOnPersist()
10186
{
10287
$model = new SubscriberList();

tests/Integration/Domain/Repository/Subscription/SubscriptionRepositoryTest.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
use PhpList\Core\Tests\Integration\Domain\Repository\Fixtures\SubscriptionFixture;
2020
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
2121

22-
//use Doctrine\ORM\Proxy\Proxy;
23-
2422
/**
2523
* Testcase.
2624
*
@@ -70,20 +68,6 @@ public function testFindAllReadsModelsFromDatabase()
7068
self::assertEquals($modificationDate, $model->getModificationDate());
7169
}
7270

73-
public function testCreatesSubscriberAssociationAsProxy()
74-
{
75-
$this->loadFixtures([SubscriberFixture::class, SubscriberListFixture::class, SubscriptionFixture::class]);
76-
77-
$subscriberId = 1;
78-
/** @var Subscription $model */
79-
$model = $this->subscriptionRepository->findAll()[0];
80-
$subscriber = $model->getSubscriber();
81-
82-
self::assertInstanceOf(Subscriber::class, $subscriber);
83-
// self::assertInstanceOf(Proxy::class, $subscriber); // todo: check proxy
84-
self::assertSame($subscriberId, $subscriber->getId());
85-
}
86-
8771
public function testCreationDateOfNewModelIsSetToNowOnPersist()
8872
{
8973
$this->loadFixtures([SubscriberFixture::class, SubscriberListFixture::class]);

0 commit comments

Comments
 (0)