diff --git a/config/packages/fos_elastica.php b/config/packages/fos_elastica.php index 5dd074a84c..1f8802d606 100644 --- a/config/packages/fos_elastica.php +++ b/config/packages/fos_elastica.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; @@ -87,7 +87,7 @@ ], 'persistence' => [ 'driver' => 'orm', - 'model' => Program::class, + 'model' => Project::class, ], ], 'app_user' => [ diff --git a/config/packages/sonata_admin.php b/config/packages/sonata_admin.php index eadde341dd..58f6db6a3c 100644 --- a/config/packages/sonata_admin.php +++ b/config/packages/sonata_admin.php @@ -112,8 +112,8 @@ 'translation_domain' => 'catroweb', 'icon' => '', 'items' => [ - 'admin.block.featured.program', - 'admin.block.example.program', + 'admin.block.featured.project', + 'admin.block.example.project', ], ], 'sonata.admin.group.mediapackage' => [ diff --git a/config/services.php b/config/services.php index 670e950edc..52b1513dc0 100644 --- a/config/services.php +++ b/config/services.php @@ -80,10 +80,10 @@ use App\DB\Entity\MediaLibrary\MediaPackageCategory; use App\DB\Entity\MediaLibrary\MediaPackageFile; use App\DB\Entity\Project\Extension; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\ProgramInappropriateReport; -use App\DB\Entity\Project\Special\ExampleProgram; -use App\DB\Entity\Project\Special\FeaturedProgram; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\ProjectInappropriateReport; +use App\DB\Entity\Project\Special\ExampleProject; +use App\DB\Entity\Project\Special\FeaturedProject; use App\DB\Entity\Project\Tag; use App\DB\Entity\Survey; use App\DB\Entity\System\CronJob; @@ -223,7 +223,7 @@ ->bind('$catrobat_translation_dir', '%catrobat.translations.dir%') ->bind('$catrobat_file_storage_dir', '%catrobat.file.storage.dir%') ->bind('$catrobat_file_extract_dir', '%catrobat.file.extract.dir%') - ->bind('$program_finder', service('fos_elastica.finder.app_program')) + ->bind('$project_finder', service('fos_elastica.finder.app_program')) ->bind('$user_finder', service('fos_elastica.finder.app_user')) ->bind('$refresh_token_ttl', '%lexik_jwt_authentication.token_ttl%') ->bind('$dkim_private_key_path', '%dkim.private.key%') @@ -467,7 +467,7 @@ ; $services->set(ProjectPostUpdateNotifier::class) - ->tag('doctrine.orm.entity_listener', ['event' => 'postUpdate', 'entity' => Program::class]) + ->tag('doctrine.orm.entity_listener', ['event' => 'postUpdate', 'entity' => Project::class]) ; $services->set(UserPostPersistNotifier::class) @@ -606,17 +606,17 @@ ; $services->set('admin.block.projects.overview', ProjectsAdmin::class) - ->tag('sonata.admin', ['manager_type' => 'orm', 'label' => 'Projects Overview', 'show_mosaic_button' => false, 'default' => true, 'code' => null, 'model_class' => Program::class, 'controller' => null]) + ->tag('sonata.admin', ['manager_type' => 'orm', 'label' => 'Projects Overview', 'show_mosaic_button' => false, 'default' => true, 'code' => null, 'model_class' => Project::class, 'controller' => null]) ->public() ; $services->set('admin.block.projects.approve', ApproveProjectsAdmin::class) - ->tag('sonata.admin', ['manager_type' => 'orm', 'label' => 'Approve Projects', 'code' => null, 'model_class' => Program::class, 'controller' => ApproveProjectsController::class]) + ->tag('sonata.admin', ['manager_type' => 'orm', 'label' => 'Approve Projects', 'code' => null, 'model_class' => Project::class, 'controller' => ApproveProjectsController::class]) ->public() ; $services->set('admin.block.projects.reported', ReportedProjectsAdmin::class) - ->tag('sonata.admin', ['manager_type' => 'orm', 'label' => 'Reported Projects', 'code' => null, 'model_class' => ProgramInappropriateReport::class, 'controller' => ReportedProjectsController::class]) + ->tag('sonata.admin', ['manager_type' => 'orm', 'label' => 'Reported Projects', 'code' => null, 'model_class' => ProjectInappropriateReport::class, 'controller' => ReportedProjectsController::class]) ->public() ; @@ -630,13 +630,13 @@ ->public() ; - $services->set('admin.block.featured.program', FeaturedProjectAdmin::class) - ->tag('sonata.admin', ['manager_type' => 'orm', 'label' => 'Featured Projects', 'code' => null, 'model_class' => FeaturedProgram::class, 'controller' => null]) + $services->set('admin.block.featured.project', FeaturedProjectAdmin::class) + ->tag('sonata.admin', ['manager_type' => 'orm', 'label' => 'Featured Projects', 'code' => null, 'model_class' => FeaturedProject::class, 'controller' => null]) ->public() ; - $services->set('admin.block.example.program', ExampleProjectAdmin::class) - ->tag('sonata.admin', ['manager_type' => 'orm', 'label' => 'Example Projects', 'code' => null, 'model_class' => ExampleProgram::class, 'controller' => null]) + $services->set('admin.block.example.project', ExampleProjectAdmin::class) + ->tag('sonata.admin', ['manager_type' => 'orm', 'label' => 'Example Projects', 'code' => null, 'model_class' => ExampleProject::class, 'controller' => null]) ->public() ; @@ -656,12 +656,12 @@ ; $services->set('admin.block.apk.pending', ApkPendingAdmin::class) - ->tag('sonata.admin', ['manager_type' => 'orm', 'label' => 'Pending', 'code' => null, 'model_class' => Program::class, 'controller' => ApkController::class]) + ->tag('sonata.admin', ['manager_type' => 'orm', 'label' => 'Pending', 'code' => null, 'model_class' => Project::class, 'controller' => ApkController::class]) ->public() ; $services->set('admin.block.apk.list', ApkReadyAdmin::class) - ->tag('sonata.admin', ['manager_type' => 'orm', 'label' => 'Ready', 'code' => null, 'model_class' => Program::class, 'controller' => ApkController::class]) + ->tag('sonata.admin', ['manager_type' => 'orm', 'label' => 'Ready', 'code' => null, 'model_class' => Project::class, 'controller' => ApkController::class]) ->public() ; diff --git a/migrations/2015/Version20150714120632.php b/migrations/2015/Version20150714120632.php index 820a30f61c..b00196dd6b 100644 --- a/migrations/2015/Version20150714120632.php +++ b/migrations/2015/Version20150714120632.php @@ -20,12 +20,12 @@ public function up(Schema $schema): void $this->addSql('CREATE TABLE fos_user (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(255) NOT NULL, username_canonical VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, email_canonical VARCHAR(255) NOT NULL, enabled TINYINT(1) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, locked TINYINT(1) NOT NULL, expired TINYINT(1) NOT NULL, expires_at DATETIME DEFAULT NULL, confirmation_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', credentials_expired TINYINT(1) NOT NULL, credentials_expire_at DATETIME DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, date_of_birth DATETIME DEFAULT NULL, firstname VARCHAR(64) DEFAULT NULL, lastname VARCHAR(64) DEFAULT NULL, website VARCHAR(64) DEFAULT NULL, biography VARCHAR(1000) DEFAULT NULL, gender VARCHAR(1) DEFAULT NULL, locale VARCHAR(8) DEFAULT NULL, timezone VARCHAR(64) DEFAULT NULL, phone VARCHAR(64) DEFAULT NULL, facebook_uid VARCHAR(255) DEFAULT NULL, facebook_name VARCHAR(255) DEFAULT NULL, facebook_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', twitter_uid VARCHAR(255) DEFAULT NULL, twitter_name VARCHAR(255) DEFAULT NULL, twitter_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', gplus_uid VARCHAR(255) DEFAULT NULL, gplus_name VARCHAR(255) DEFAULT NULL, gplus_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', token VARCHAR(255) DEFAULT NULL, two_step_code VARCHAR(255) DEFAULT NULL, upload_token VARCHAR(300) DEFAULT NULL, avatar LONGTEXT DEFAULT NULL, country VARCHAR(5) DEFAULT \'\' NOT NULL, additional_email VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_957A647992FC23A8 (username_canonical), UNIQUE INDEX UNIQ_957A6479A0D96FBF (email_canonical), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE fos_user_user_group (user_id INT NOT NULL, group_id INT NOT NULL, INDEX IDX_B3C77447A76ED395 (user_id), INDEX IDX_B3C77447FE54D947 (group_id), PRIMARY KEY(user_id, group_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE program (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, remix_id INT DEFAULT NULL, approved_by_user INT DEFAULT NULL, category_id INT DEFAULT NULL, name VARCHAR(300) NOT NULL, description LONGTEXT NOT NULL, version INT DEFAULT 1 NOT NULL, views INT NOT NULL, downloads INT NOT NULL, directory_hash VARCHAR(255) DEFAULT NULL, uploaded_at DATETIME NOT NULL, last_modified_at DATETIME NOT NULL, language_version VARCHAR(255) DEFAULT \'0\' NOT NULL, catrobat_version_name VARCHAR(255) DEFAULT \'\' NOT NULL, catrobat_version INT DEFAULT 0 NOT NULL, upload_ip VARCHAR(255) DEFAULT \'\' NOT NULL, visible TINYINT(1) DEFAULT \'1\' NOT NULL, flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL, upload_language VARCHAR(255) DEFAULT \'\' NOT NULL, filesize INT DEFAULT 0 NOT NULL, remix_count INT DEFAULT 0 NOT NULL, approved TINYINT(1) DEFAULT \'0\' NOT NULL, apk_status SMALLINT DEFAULT 0 NOT NULL, apk_request_time DATETIME DEFAULT NULL, apk_downloads INT DEFAULT 0 NOT NULL, phiro TINYINT(1) DEFAULT \'0\' NOT NULL, lego TINYINT(1) DEFAULT \'0\' NOT NULL, INDEX IDX_92ED7784A76ED395 (user_id), INDEX IDX_92ED7784451AB72F (remix_id), INDEX IDX_92ED77849D8F32D0 (approved_by_user), INDEX IDX_92ED778412469DE2 (category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); + $this->addSql('CREATE TABLE project (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, remix_id INT DEFAULT NULL, approved_by_user INT DEFAULT NULL, category_id INT DEFAULT NULL, name VARCHAR(300) NOT NULL, description LONGTEXT NOT NULL, version INT DEFAULT 1 NOT NULL, views INT NOT NULL, downloads INT NOT NULL, directory_hash VARCHAR(255) DEFAULT NULL, uploaded_at DATETIME NOT NULL, last_modified_at DATETIME NOT NULL, language_version VARCHAR(255) DEFAULT \'0\' NOT NULL, catrobat_version_name VARCHAR(255) DEFAULT \'\' NOT NULL, catrobat_version INT DEFAULT 0 NOT NULL, upload_ip VARCHAR(255) DEFAULT \'\' NOT NULL, visible TINYINT(1) DEFAULT \'1\' NOT NULL, flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL, upload_language VARCHAR(255) DEFAULT \'\' NOT NULL, filesize INT DEFAULT 0 NOT NULL, remix_count INT DEFAULT 0 NOT NULL, approved TINYINT(1) DEFAULT \'0\' NOT NULL, apk_status SMALLINT DEFAULT 0 NOT NULL, apk_request_time DATETIME DEFAULT NULL, apk_downloads INT DEFAULT 0 NOT NULL, phiro TINYINT(1) DEFAULT \'0\' NOT NULL, lego TINYINT(1) DEFAULT \'0\' NOT NULL, INDEX IDX_92ED7784A76ED395 (user_id), INDEX IDX_92ED7784451AB72F (remix_id), INDEX IDX_92ED77849D8F32D0 (approved_by_user), INDEX IDX_92ED778412469DE2 (category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE fos_user_group (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, roles LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', UNIQUE INDEX UNIQ_583D1F3E5E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE starter_category (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, alias VARCHAR(255) NOT NULL, order_pos INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE Notification (id INT AUTO_INCREMENT NOT NULL, user INT NOT NULL, upload TINYINT(1) NOT NULL, report TINYINT(1) NOT NULL, summary TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_A765AD328D93D649 (user), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE featured (id INT AUTO_INCREMENT NOT NULL, program_id INT DEFAULT NULL, imagetype VARCHAR(255) NOT NULL, url VARCHAR(255) DEFAULT NULL, active TINYINT(1) NOT NULL, flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL, INDEX IDX_3C1359D43EB8070A (program_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE ProgramInappropriateReport (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, program_id INT DEFAULT NULL, note LONGTEXT NOT NULL, time DATETIME NOT NULL, state INT NOT NULL, projectVersion INT NOT NULL, INDEX IDX_ED222248A76ED395 (user_id), INDEX IDX_ED2222483EB8070A (program_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); + $this->addSql('CREATE TABLE featured (id INT AUTO_INCREMENT NOT NULL, project_id INT DEFAULT NULL, imagetype VARCHAR(255) NOT NULL, url VARCHAR(255) DEFAULT NULL, active TINYINT(1) NOT NULL, flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL, INDEX IDX_3C1359D43EB8070A (project_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); + $this->addSql('CREATE TABLE ProjectInappropriateReport (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, project_id INT DEFAULT NULL, note LONGTEXT NOT NULL, time DATETIME NOT NULL, state INT NOT NULL, projectVersion INT NOT NULL, INDEX IDX_ED222248A76ED395 (user_id), INDEX IDX_ED2222483EB8070A (project_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE rudewords (id INT AUTO_INCREMENT NOT NULL, word VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE acl_classes (id INT UNSIGNED AUTO_INCREMENT NOT NULL, class_type VARCHAR(200) NOT NULL, UNIQUE INDEX UNIQ_69DD750638A36066 (class_type), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE acl_security_identities (id INT UNSIGNED AUTO_INCREMENT NOT NULL, identifier VARCHAR(200) NOT NULL, username TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_8835EE78772E836AF85E0677 (identifier, username), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); @@ -34,14 +34,14 @@ public function up(Schema $schema): void $this->addSql('CREATE TABLE acl_entries (id INT UNSIGNED AUTO_INCREMENT NOT NULL, class_id INT UNSIGNED NOT NULL, object_identity_id INT UNSIGNED DEFAULT NULL, security_identity_id INT UNSIGNED NOT NULL, field_name VARCHAR(50) DEFAULT NULL, ace_order SMALLINT UNSIGNED NOT NULL, mask INT NOT NULL, granting TINYINT(1) NOT NULL, granting_strategy VARCHAR(30) NOT NULL, audit_success TINYINT(1) NOT NULL, audit_failure TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_46C8B806EA000B103D9AB4A64DEF17BCE4289BF4 (class_id, object_identity_id, field_name, ace_order), INDEX IDX_46C8B806EA000B103D9AB4A6DF9183C9 (class_id, object_identity_id, security_identity_id), INDEX IDX_46C8B806EA000B10 (class_id), INDEX IDX_46C8B8063D9AB4A6 (object_identity_id), INDEX IDX_46C8B806DF9183C9 (security_identity_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('ALTER TABLE fos_user_user_group ADD CONSTRAINT FK_B3C77447A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE fos_user_user_group ADD CONSTRAINT FK_B3C77447FE54D947 FOREIGN KEY (group_id) REFERENCES fos_user_group (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE program ADD CONSTRAINT FK_92ED7784A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE program ADD CONSTRAINT FK_92ED7784451AB72F FOREIGN KEY (remix_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program ADD CONSTRAINT FK_92ED77849D8F32D0 FOREIGN KEY (approved_by_user) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE program ADD CONSTRAINT FK_92ED778412469DE2 FOREIGN KEY (category_id) REFERENCES starter_category (id)'); + $this->addSql('ALTER TABLE project ADD CONSTRAINT FK_92ED7784A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); + $this->addSql('ALTER TABLE project ADD CONSTRAINT FK_92ED7784451AB72F FOREIGN KEY (remix_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project ADD CONSTRAINT FK_92ED77849D8F32D0 FOREIGN KEY (approved_by_user) REFERENCES fos_user (id)'); + $this->addSql('ALTER TABLE project ADD CONSTRAINT FK_92ED778412469DE2 FOREIGN KEY (category_id) REFERENCES starter_category (id)'); $this->addSql('ALTER TABLE Notification ADD CONSTRAINT FK_A765AD328D93D649 FOREIGN KEY (user) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE featured ADD CONSTRAINT FK_3C1359D43EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE ProgramInappropriateReport ADD CONSTRAINT FK_ED222248A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE ProgramInappropriateReport ADD CONSTRAINT FK_ED2222483EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); + $this->addSql('ALTER TABLE featured ADD CONSTRAINT FK_3C1359D43EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE ProjectInappropriateReport ADD CONSTRAINT FK_ED222248A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); + $this->addSql('ALTER TABLE ProjectInappropriateReport ADD CONSTRAINT FK_ED2222483EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); $this->addSql('ALTER TABLE acl_object_identities ADD CONSTRAINT FK_9407E54977FA751A FOREIGN KEY (parent_object_identity_id) REFERENCES acl_object_identities (id)'); $this->addSql('ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE2993D9AB4A6 FOREIGN KEY (object_identity_id) REFERENCES acl_object_identities (id) ON UPDATE CASCADE ON DELETE CASCADE'); $this->addSql('ALTER TABLE acl_object_identity_ancestors ADD CONSTRAINT FK_825DE299C671CEA1 FOREIGN KEY (ancestor_id) REFERENCES acl_object_identities (id) ON UPDATE CASCADE ON DELETE CASCADE'); @@ -59,15 +59,15 @@ public function down(Schema $schema): void $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE fos_user_user_group DROP FOREIGN KEY FK_B3C77447A76ED395'); - $this->addSql('ALTER TABLE program DROP FOREIGN KEY FK_92ED7784A76ED395'); - $this->addSql('ALTER TABLE program DROP FOREIGN KEY FK_92ED77849D8F32D0'); + $this->addSql('ALTER TABLE project DROP FOREIGN KEY FK_92ED7784A76ED395'); + $this->addSql('ALTER TABLE project DROP FOREIGN KEY FK_92ED77849D8F32D0'); $this->addSql('ALTER TABLE Notification DROP FOREIGN KEY FK_A765AD328D93D649'); - $this->addSql('ALTER TABLE ProgramInappropriateReport DROP FOREIGN KEY FK_ED222248A76ED395'); - $this->addSql('ALTER TABLE program DROP FOREIGN KEY FK_92ED7784451AB72F'); + $this->addSql('ALTER TABLE ProjectInappropriateReport DROP FOREIGN KEY FK_ED222248A76ED395'); + $this->addSql('ALTER TABLE project DROP FOREIGN KEY FK_92ED7784451AB72F'); $this->addSql('ALTER TABLE featured DROP FOREIGN KEY FK_3C1359D43EB8070A'); - $this->addSql('ALTER TABLE ProgramInappropriateReport DROP FOREIGN KEY FK_ED2222483EB8070A'); + $this->addSql('ALTER TABLE ProjectInappropriateReport DROP FOREIGN KEY FK_ED2222483EB8070A'); $this->addSql('ALTER TABLE fos_user_user_group DROP FOREIGN KEY FK_B3C77447FE54D947'); - $this->addSql('ALTER TABLE program DROP FOREIGN KEY FK_92ED778412469DE2'); + $this->addSql('ALTER TABLE project DROP FOREIGN KEY FK_92ED778412469DE2'); $this->addSql('ALTER TABLE acl_entries DROP FOREIGN KEY FK_46C8B806EA000B10'); $this->addSql('ALTER TABLE acl_entries DROP FOREIGN KEY FK_46C8B806DF9183C9'); $this->addSql('ALTER TABLE acl_object_identities DROP FOREIGN KEY FK_9407E54977FA751A'); @@ -76,12 +76,12 @@ public function down(Schema $schema): void $this->addSql('ALTER TABLE acl_entries DROP FOREIGN KEY FK_46C8B8063D9AB4A6'); $this->addSql('DROP TABLE fos_user'); $this->addSql('DROP TABLE fos_user_user_group'); - $this->addSql('DROP TABLE program'); + $this->addSql('DROP TABLE project'); $this->addSql('DROP TABLE fos_user_group'); $this->addSql('DROP TABLE starter_category'); $this->addSql('DROP TABLE Notification'); $this->addSql('DROP TABLE featured'); - $this->addSql('DROP TABLE ProgramInappropriateReport'); + $this->addSql('DROP TABLE ProjectInappropriateReport'); $this->addSql('DROP TABLE rudewords'); $this->addSql('DROP TABLE acl_classes'); $this->addSql('DROP TABLE acl_security_identities'); diff --git a/migrations/2015/Version20151027125009.php b/migrations/2015/Version20151027125009.php index 00e45e5e8b..d5bea4fd77 100644 --- a/migrations/2015/Version20151027125009.php +++ b/migrations/2015/Version20151027125009.php @@ -19,12 +19,12 @@ public function up(Schema $schema): void $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('CREATE TABLE GameJam (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(300) NOT NULL, form_url VARCHAR(300) DEFAULT NULL, start DATETIME NOT NULL, end DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE gamejams_sampleprograms (gamejam_id INT NOT NULL, program_id INT NOT NULL, INDEX IDX_8EADA13654B8758D (gamejam_id), INDEX IDX_8EADA1363EB8070A (program_id), PRIMARY KEY(gamejam_id, program_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('ALTER TABLE gamejams_sampleprograms ADD CONSTRAINT FK_8EADA13654B8758D FOREIGN KEY (gamejam_id) REFERENCES GameJam (id)'); - $this->addSql('ALTER TABLE gamejams_sampleprograms ADD CONSTRAINT FK_8EADA1363EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program ADD gamejam_id INT DEFAULT NULL, ADD gamejam_submission_accepted TINYINT(1) DEFAULT \'0\' NOT NULL, ADD gamejam_submission_date DATETIME DEFAULT NULL'); - $this->addSql('ALTER TABLE program ADD CONSTRAINT FK_92ED778454B8758D FOREIGN KEY (gamejam_id) REFERENCES GameJam (id)'); - $this->addSql('CREATE INDEX IDX_92ED778454B8758D ON program (gamejam_id)'); + $this->addSql('CREATE TABLE gamejams_sampleprojects (gamejam_id INT NOT NULL, project_id INT NOT NULL, INDEX IDX_8EADA13654B8758D (gamejam_id), INDEX IDX_8EADA1363EB8070A (project_id), PRIMARY KEY(gamejam_id, project_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); + $this->addSql('ALTER TABLE gamejams_sampleprojects ADD CONSTRAINT FK_8EADA13654B8758D FOREIGN KEY (gamejam_id) REFERENCES GameJam (id)'); + $this->addSql('ALTER TABLE gamejams_sampleprojects ADD CONSTRAINT FK_8EADA1363EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project ADD gamejam_id INT DEFAULT NULL, ADD gamejam_submission_accepted TINYINT(1) DEFAULT \'0\' NOT NULL, ADD gamejam_submission_date DATETIME DEFAULT NULL'); + $this->addSql('ALTER TABLE project ADD CONSTRAINT FK_92ED778454B8758D FOREIGN KEY (gamejam_id) REFERENCES GameJam (id)'); + $this->addSql('CREATE INDEX IDX_92ED778454B8758D ON project (gamejam_id)'); } /** @@ -35,11 +35,11 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program DROP FOREIGN KEY FK_92ED778454B8758D'); - $this->addSql('ALTER TABLE gamejams_sampleprograms DROP FOREIGN KEY FK_8EADA13654B8758D'); + $this->addSql('ALTER TABLE project DROP FOREIGN KEY FK_92ED778454B8758D'); + $this->addSql('ALTER TABLE gamejams_sampleprojects DROP FOREIGN KEY FK_8EADA13654B8758D'); $this->addSql('DROP TABLE GameJam'); - $this->addSql('DROP TABLE gamejams_sampleprograms'); - $this->addSql('DROP INDEX IDX_92ED778454B8758D ON program'); - $this->addSql('ALTER TABLE program DROP gamejam_id, DROP gamejam_submission_accepted, DROP gamejam_submission_date'); + $this->addSql('DROP TABLE gamejams_sampleprojects'); + $this->addSql('DROP INDEX IDX_92ED778454B8758D ON project'); + $this->addSql('ALTER TABLE project DROP gamejam_id, DROP gamejam_submission_accepted, DROP gamejam_submission_date'); } } diff --git a/migrations/2015/Version20151118124632.php b/migrations/2015/Version20151118124632.php index 75af4238b0..5360c44d98 100644 --- a/migrations/2015/Version20151118124632.php +++ b/migrations/2015/Version20151118124632.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program ADD fb_post_id VARCHAR(255) DEFAULT NULL'); + $this->addSql('ALTER TABLE project ADD fb_post_id VARCHAR(255) DEFAULT NULL'); } /** @@ -29,6 +29,6 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program DROP fb_post_id'); + $this->addSql('ALTER TABLE project DROP fb_post_id'); } } diff --git a/migrations/2015/Version20151126103942.php b/migrations/2015/Version20151126103942.php index 615d109ecf..871ebbbfa6 100644 --- a/migrations/2015/Version20151126103942.php +++ b/migrations/2015/Version20151126103942.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program ADD fb_post_url VARCHAR(255) DEFAULT NULL'); + $this->addSql('ALTER TABLE project ADD fb_post_url VARCHAR(255) DEFAULT NULL'); } /** @@ -29,6 +29,6 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program DROP fb_post_url'); + $this->addSql('ALTER TABLE project DROP fb_post_url'); } } diff --git a/migrations/2015/Version20151127124126.php b/migrations/2015/Version20151127124126.php index 0a9ccdabeb..079cc42166 100644 --- a/migrations/2015/Version20151127124126.php +++ b/migrations/2015/Version20151127124126.php @@ -18,8 +18,8 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('CREATE TABLE program_downloads (id INT AUTO_INCREMENT NOT NULL, program_id INT NOT NULL, downloaded_at DATETIME NOT NULL, ip LONGTEXT NOT NULL, latitude LONGTEXT DEFAULT NULL, longitude LONGTEXT DEFAULT NULL, country_code LONGTEXT DEFAULT NULL, country_name LONGTEXT DEFAULT NULL, street VARCHAR(255) DEFAULT \'\', postal_code VARCHAR(255) DEFAULT \'\', locality VARCHAR(255) DEFAULT \'\', INDEX IDX_1D41556A3EB8070A (program_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('ALTER TABLE program_downloads ADD CONSTRAINT FK_1D41556A3EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); + $this->addSql('CREATE TABLE project_downloads (id INT AUTO_INCREMENT NOT NULL, project_id INT NOT NULL, downloaded_at DATETIME NOT NULL, ip LONGTEXT NOT NULL, latitude LONGTEXT DEFAULT NULL, longitude LONGTEXT DEFAULT NULL, country_code LONGTEXT DEFAULT NULL, country_name LONGTEXT DEFAULT NULL, street VARCHAR(255) DEFAULT \'\', postal_code VARCHAR(255) DEFAULT \'\', locality VARCHAR(255) DEFAULT \'\', INDEX IDX_1D41556A3EB8070A (project_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); + $this->addSql('ALTER TABLE project_downloads ADD CONSTRAINT FK_1D41556A3EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); } /** @@ -30,6 +30,6 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('DROP TABLE program_downloads'); + $this->addSql('DROP TABLE project_downloads'); } } diff --git a/migrations/2015/Version20151202143100.php b/migrations/2015/Version20151202143100.php index 3bb19eab9c..2f18dbac11 100644 --- a/migrations/2015/Version20151202143100.php +++ b/migrations/2015/Version20151202143100.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program_downloads ADD user_agent VARCHAR(255) DEFAULT \'\''); + $this->addSql('ALTER TABLE project_downloads ADD user_agent VARCHAR(255) DEFAULT \'\''); } /** @@ -29,6 +29,6 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program_downloads DROP user_agent'); + $this->addSql('ALTER TABLE project_downloads DROP user_agent'); } } diff --git a/migrations/2015/Version20151222230242.php b/migrations/2015/Version20151222230242.php index c0aae10a91..7c06deb28c 100644 --- a/migrations/2015/Version20151222230242.php +++ b/migrations/2015/Version20151222230242.php @@ -18,9 +18,9 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program_downloads ADD user_id INT DEFAULT NULL, ADD referrer VARCHAR(255) DEFAULT \'\''); - $this->addSql('ALTER TABLE program_downloads ADD CONSTRAINT FK_1D41556AA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); - $this->addSql('CREATE INDEX IDX_1D41556AA76ED395 ON program_downloads (user_id)'); + $this->addSql('ALTER TABLE project_downloads ADD user_id INT DEFAULT NULL, ADD referrer VARCHAR(255) DEFAULT \'\''); + $this->addSql('ALTER TABLE project_downloads ADD CONSTRAINT FK_1D41556AA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); + $this->addSql('CREATE INDEX IDX_1D41556AA76ED395 ON project_downloads (user_id)'); } /** @@ -31,8 +31,8 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program_downloads DROP FOREIGN KEY FK_1D41556AA76ED395'); - $this->addSql('DROP INDEX IDX_1D41556AA76ED395 ON program_downloads'); - $this->addSql('ALTER TABLE program_downloads DROP user_id, DROP referrer'); + $this->addSql('ALTER TABLE project_downloads DROP FOREIGN KEY FK_1D41556AA76ED395'); + $this->addSql('DROP INDEX IDX_1D41556AA76ED395 ON project_downloads'); + $this->addSql('ALTER TABLE project_downloads DROP user_id, DROP referrer'); } } diff --git a/migrations/2016/Version20160319100110.php b/migrations/2016/Version20160319100110.php index 18796c3d0e..4e694ae6fb 100644 --- a/migrations/2016/Version20160319100110.php +++ b/migrations/2016/Version20160319100110.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('CREATE TABLE user_comment (id INT AUTO_INCREMENT NOT NULL, programId INT NOT NULL, userId INT NOT NULL, uploadDate DATE NOT NULL, text LONGTEXT NOT NULL, username VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); + $this->addSql('CREATE TABLE user_comment (id INT AUTO_INCREMENT NOT NULL, projectId INT NOT NULL, userId INT NOT NULL, uploadDate DATE NOT NULL, text LONGTEXT NOT NULL, username VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); } /** diff --git a/migrations/2016/Version20160420162057.php b/migrations/2016/Version20160420162057.php index 89b599418b..65e2e3d99f 100644 --- a/migrations/2016/Version20160420162057.php +++ b/migrations/2016/Version20160420162057.php @@ -18,10 +18,10 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('CREATE TABLE program_tag (program_id INT NOT NULL, tag_id INT NOT NULL, INDEX IDX_88B68E093EB8070A (program_id), INDEX IDX_88B68E09BAD26311 (tag_id), PRIMARY KEY(program_id, tag_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); + $this->addSql('CREATE TABLE project_tag (project_id INT NOT NULL, tag_id INT NOT NULL, INDEX IDX_88B68E093EB8070A (project_id), INDEX IDX_88B68E09BAD26311 (tag_id), PRIMARY KEY(project_id, tag_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE tags (id INT AUTO_INCREMENT NOT NULL, en VARCHAR(255) DEFAULT NULL, de VARCHAR(255) DEFAULT NULL, it VARCHAR(255) DEFAULT NULL, fr VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('ALTER TABLE program_tag ADD CONSTRAINT FK_88B68E093EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program_tag ADD CONSTRAINT FK_88B68E09BAD26311 FOREIGN KEY (tag_id) REFERENCES tags (id)'); + $this->addSql('ALTER TABLE project_tag ADD CONSTRAINT FK_88B68E093EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project_tag ADD CONSTRAINT FK_88B68E09BAD26311 FOREIGN KEY (tag_id) REFERENCES tags (id)'); } /** @@ -32,8 +32,8 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program_tag DROP FOREIGN KEY FK_88B68E09BAD26311'); - $this->addSql('DROP TABLE program_tag'); + $this->addSql('ALTER TABLE project_tag DROP FOREIGN KEY FK_88B68E09BAD26311'); + $this->addSql('DROP TABLE project_tag'); $this->addSql('DROP TABLE tags'); } } diff --git a/migrations/2016/Version20160602192921.php b/migrations/2016/Version20160602192921.php index 0edeeac69d..1476fbf0aa 100644 --- a/migrations/2016/Version20160602192921.php +++ b/migrations/2016/Version20160602192921.php @@ -18,10 +18,10 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('CREATE TABLE program_extension (program_id INT NOT NULL, extension_id INT NOT NULL, INDEX IDX_C985CCA83EB8070A (program_id), INDEX IDX_C985CCA8812D5EB (extension_id), PRIMARY KEY(program_id, extension_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); + $this->addSql('CREATE TABLE project_extension (project_id INT NOT NULL, extension_id INT NOT NULL, INDEX IDX_C985CCA83EB8070A (project_id), INDEX IDX_C985CCA8812D5EB (extension_id), PRIMARY KEY(project_id, extension_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE extension (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) DEFAULT NULL, prefix VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('ALTER TABLE program_extension ADD CONSTRAINT FK_C985CCA83EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program_extension ADD CONSTRAINT FK_C985CCA8812D5EB FOREIGN KEY (extension_id) REFERENCES extension (id)'); + $this->addSql('ALTER TABLE project_extension ADD CONSTRAINT FK_C985CCA83EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project_extension ADD CONSTRAINT FK_C985CCA8812D5EB FOREIGN KEY (extension_id) REFERENCES extension (id)'); } public function postUp(Schema $schema): void @@ -34,20 +34,20 @@ public function postUp(Schema $schema): void $this->connection->insert('extension', ['name' => 'Phiro', 'prefix' => 'PHIRO']); $this->connection->insert('extension', ['name' => 'Raspberry Pi', 'prefix' => 'RASPI']); - $sql = 'SELECT id FROM program WHERE lego = 1'; + $sql = 'SELECT id FROM project WHERE lego = 1'; $query = $this->connection->query($sql); - while ($program = $query->fetch()) { - $this->connection->insert('program_extension', ['program_id' => $program['id'], 'extension_id' => 3]); + while ($project = $query->fetch()) { + $this->connection->insert('project_extension', ['project_id' => $project['id'], 'extension_id' => 3]); } - $sql_2 = 'SELECT id FROM program WHERE phiro = 1'; + $sql_2 = 'SELECT id FROM project WHERE phiro = 1'; $query_2 = $this->connection->query($sql_2); - while ($program = $query_2->fetch()) { - $this->connection->insert('program_extension', ['program_id' => $program['id'], 'extension_id' => 4]); + while ($project = $query_2->fetch()) { + $this->connection->insert('project_extension', ['project_id' => $project['id'], 'extension_id' => 4]); } } @@ -59,8 +59,8 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program_extension DROP FOREIGN KEY FK_C985CCA8812D5EB'); - $this->addSql('DROP TABLE program_extension'); + $this->addSql('ALTER TABLE project_extension DROP FOREIGN KEY FK_C985CCA8812D5EB'); + $this->addSql('DROP TABLE project_extension'); $this->addSql('DROP TABLE extension'); } @@ -68,20 +68,20 @@ public function preDown(Schema $schema): void { parent::preDown($schema); - $sql = 'SELECT program_id FROM program_extension WHERE extension_id = 3'; + $sql = 'SELECT project_id FROM project_extension WHERE extension_id = 3'; $query = $this->connection->query($sql); - while ($program = $query->fetch()) { - $this->connection->update('program', ['lego' => 1], ['id' => $program['program_id']]); + while ($project = $query->fetch()) { + $this->connection->update('project', ['lego' => 1], ['id' => $project['project_id']]); } - $sql_2 = 'SELECT program_id FROM program_extension WHERE extension_id = 4'; + $sql_2 = 'SELECT project_id FROM project_extension WHERE extension_id = 4'; $query_2 = $this->connection->query($sql_2); - while ($program = $query_2->fetch()) { - $this->connection->update('program', ['phiro' => 1], ['id' => $program['program_id']]); + while ($project = $query_2->fetch()) { + $this->connection->update('project', ['phiro' => 1], ['id' => $project['project_id']]); } } } diff --git a/migrations/2016/Version20160606161746.php b/migrations/2016/Version20160606161746.php index b66bf29440..6f35de472e 100644 --- a/migrations/2016/Version20160606161746.php +++ b/migrations/2016/Version20160606161746.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program DROP phiro, DROP lego'); + $this->addSql('ALTER TABLE project DROP phiro, DROP lego'); } /** @@ -29,6 +29,6 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program ADD phiro TINYINT(1) DEFAULT \'0\' NOT NULL, ADD lego TINYINT(1) DEFAULT \'0\' NOT NULL'); + $this->addSql('ALTER TABLE project ADD phiro TINYINT(1) DEFAULT \'0\' NOT NULL, ADD lego TINYINT(1) DEFAULT \'0\' NOT NULL'); } } diff --git a/migrations/2016/Version20160827124510.php b/migrations/2016/Version20160827124510.php index b4082af4ef..c8c880efe6 100644 --- a/migrations/2016/Version20160827124510.php +++ b/migrations/2016/Version20160827124510.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program ADD private TINYINT(1) DEFAULT \'0\' NOT NULL'); + $this->addSql('ALTER TABLE project ADD private TINYINT(1) DEFAULT \'0\' NOT NULL'); } /** @@ -29,6 +29,6 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program DROP private'); + $this->addSql('ALTER TABLE project DROP private'); } } diff --git a/migrations/2016/Version20160831235704.php b/migrations/2016/Version20160831235704.php index afb99fcc1c..07f2951fdd 100644 --- a/migrations/2016/Version20160831235704.php +++ b/migrations/2016/Version20160831235704.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program CHANGE private private TINYINT(1) DEFAULT \'0\''); + $this->addSql('ALTER TABLE project CHANGE private private TINYINT(1) DEFAULT \'0\''); } /** @@ -29,7 +29,7 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program CHANGE private private TINYINT(1) DEFAULT \'0\' NOT NULL'); + $this->addSql('ALTER TABLE project CHANGE private private TINYINT(1) DEFAULT \'0\' NOT NULL'); } } diff --git a/migrations/2016/Version20160909120051.php b/migrations/2016/Version20160909120051.php index cbac2fefe8..0f1f203c57 100644 --- a/migrations/2016/Version20160909120051.php +++ b/migrations/2016/Version20160909120051.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program CHANGE private private TINYINT(1) DEFAULT \'0\' NOT NULL'); + $this->addSql('ALTER TABLE project CHANGE private private TINYINT(1) DEFAULT \'0\' NOT NULL'); $this->addSql('ALTER TABLE GameJam ADD flavor VARCHAR(100) DEFAULT NULL'); } @@ -31,6 +31,6 @@ public function down(Schema $schema): void $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE GameJam DROP flavor'); - $this->addSql('ALTER TABLE program CHANGE private private TINYINT(1) DEFAULT \'0\''); + $this->addSql('ALTER TABLE project CHANGE private private TINYINT(1) DEFAULT \'0\''); } } diff --git a/migrations/2016/Version20161226072944.php b/migrations/2016/Version20161226072944.php index 4f273beeb1..1f6cda198e 100644 --- a/migrations/2016/Version20161226072944.php +++ b/migrations/2016/Version20161226072944.php @@ -18,18 +18,18 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('CREATE TABLE program_remix_relation (ancestor_id INT NOT NULL, descendant_id INT NOT NULL, depth INT DEFAULT 0 NOT NULL, created_at DATETIME NOT NULL, seen_at DATETIME DEFAULT NULL, INDEX IDX_E5AD23B4C671CEA1 (ancestor_id), INDEX IDX_E5AD23B41844467D (descendant_id), PRIMARY KEY(ancestor_id, descendant_id, depth)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE program_remix_backward_relation (parent_id INT NOT NULL, child_id INT NOT NULL, created_at DATETIME NOT NULL, seen_at DATETIME DEFAULT NULL, INDEX IDX_C294015B727ACA70 (parent_id), INDEX IDX_C294015BDD62C21B (child_id), PRIMARY KEY(parent_id, child_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE scratch_program_remix_relation (scratch_parent_id INT NOT NULL, catrobat_child_id INT NOT NULL, INDEX IDX_3B275E756F212B35 (catrobat_child_id), PRIMARY KEY(scratch_parent_id, catrobat_child_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE scratch_program (id INT NOT NULL, name VARCHAR(300) DEFAULT NULL, description LONGTEXT DEFAULT NULL, username LONGTEXT DEFAULT NULL, last_modified_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('ALTER TABLE program_remix_relation ADD CONSTRAINT FK_E5AD23B4C671CEA1 FOREIGN KEY (ancestor_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program_remix_relation ADD CONSTRAINT FK_E5AD23B41844467D FOREIGN KEY (descendant_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program_remix_backward_relation ADD CONSTRAINT FK_C294015B727ACA70 FOREIGN KEY (parent_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program_remix_backward_relation ADD CONSTRAINT FK_C294015BDD62C21B FOREIGN KEY (child_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE scratch_program_remix_relation ADD CONSTRAINT FK_3B275E756F212B35 FOREIGN KEY (catrobat_child_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program DROP FOREIGN KEY FK_92ED7784451AB72F'); - $this->addSql('DROP INDEX IDX_92ED7784451AB72F ON program'); - $this->addSql('ALTER TABLE program ADD remix_root TINYINT(1) DEFAULT \'1\' NOT NULL, ADD remix_migrated_at DATETIME DEFAULT NULL, DROP remix_id, DROP remix_count, CHANGE private private TINYINT(1) DEFAULT \'0\' NOT NULL'); + $this->addSql('CREATE TABLE project_remix_relation (ancestor_id INT NOT NULL, descendant_id INT NOT NULL, depth INT DEFAULT 0 NOT NULL, created_at DATETIME NOT NULL, seen_at DATETIME DEFAULT NULL, INDEX IDX_E5AD23B4C671CEA1 (ancestor_id), INDEX IDX_E5AD23B41844467D (descendant_id), PRIMARY KEY(ancestor_id, descendant_id, depth)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); + $this->addSql('CREATE TABLE project_remix_backward_relation (parent_id INT NOT NULL, child_id INT NOT NULL, created_at DATETIME NOT NULL, seen_at DATETIME DEFAULT NULL, INDEX IDX_C294015B727ACA70 (parent_id), INDEX IDX_C294015BDD62C21B (child_id), PRIMARY KEY(parent_id, child_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); + $this->addSql('CREATE TABLE scratch_project_remix_relation (scratch_parent_id INT NOT NULL, catrobat_child_id INT NOT NULL, INDEX IDX_3B275E756F212B35 (catrobat_child_id), PRIMARY KEY(scratch_parent_id, catrobat_child_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); + $this->addSql('CREATE TABLE scratch_project (id INT NOT NULL, name VARCHAR(300) DEFAULT NULL, description LONGTEXT DEFAULT NULL, username LONGTEXT DEFAULT NULL, last_modified_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); + $this->addSql('ALTER TABLE project_remix_relation ADD CONSTRAINT FK_E5AD23B4C671CEA1 FOREIGN KEY (ancestor_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project_remix_relation ADD CONSTRAINT FK_E5AD23B41844467D FOREIGN KEY (descendant_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project_remix_backward_relation ADD CONSTRAINT FK_C294015B727ACA70 FOREIGN KEY (parent_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project_remix_backward_relation ADD CONSTRAINT FK_C294015BDD62C21B FOREIGN KEY (child_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE scratch_project_remix_relation ADD CONSTRAINT FK_3B275E756F212B35 FOREIGN KEY (catrobat_child_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project DROP FOREIGN KEY FK_92ED7784451AB72F'); + $this->addSql('DROP INDEX IDX_92ED7784451AB72F ON project'); + $this->addSql('ALTER TABLE project ADD remix_root TINYINT(1) DEFAULT \'1\' NOT NULL, ADD remix_migrated_at DATETIME DEFAULT NULL, DROP remix_id, DROP remix_count, CHANGE private private TINYINT(1) DEFAULT \'0\' NOT NULL'); } /** @@ -40,12 +40,12 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('DROP TABLE program_remix_relation'); - $this->addSql('DROP TABLE program_remix_backward_relation'); - $this->addSql('DROP TABLE scratch_program_remix_relation'); - $this->addSql('DROP TABLE scratch_program'); - $this->addSql('ALTER TABLE program ADD remix_id INT DEFAULT NULL, ADD remix_count INT DEFAULT 0 NOT NULL, DROP remix_root, DROP remix_migrated_at, CHANGE private private TINYINT(1) DEFAULT \'0\''); - $this->addSql('ALTER TABLE program ADD CONSTRAINT FK_92ED7784451AB72F FOREIGN KEY (remix_id) REFERENCES program (id)'); - $this->addSql('CREATE INDEX IDX_92ED7784451AB72F ON program (remix_id)'); + $this->addSql('DROP TABLE project_remix_relation'); + $this->addSql('DROP TABLE project_remix_backward_relation'); + $this->addSql('DROP TABLE scratch_project_remix_relation'); + $this->addSql('DROP TABLE scratch_project'); + $this->addSql('ALTER TABLE project ADD remix_id INT DEFAULT NULL, ADD remix_count INT DEFAULT 0 NOT NULL, DROP remix_root, DROP remix_migrated_at, CHANGE private private TINYINT(1) DEFAULT \'0\''); + $this->addSql('ALTER TABLE project ADD CONSTRAINT FK_92ED7784451AB72F FOREIGN KEY (remix_id) REFERENCES project (id)'); + $this->addSql('CREATE INDEX IDX_92ED7784451AB72F ON project (remix_id)'); } } diff --git a/migrations/2017/Version20170120184527.php b/migrations/2017/Version20170120184527.php index 7a2387e0b1..d85b395f10 100644 --- a/migrations/2017/Version20170120184527.php +++ b/migrations/2017/Version20170120184527.php @@ -18,15 +18,15 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('CREATE TABLE click_statistics (id INT AUTO_INCREMENT NOT NULL, tag_id INT DEFAULT NULL, extension_id INT DEFAULT NULL, program_id INT DEFAULT NULL, rec_from_program_id INT DEFAULT NULL, user_id INT DEFAULT NULL, type LONGTEXT NOT NULL, clicked_at DATETIME NOT NULL, ip LONGTEXT NOT NULL, latitude LONGTEXT DEFAULT NULL, longitude LONGTEXT DEFAULT NULL, country_code LONGTEXT DEFAULT NULL, country_name LONGTEXT DEFAULT NULL, street VARCHAR(255) DEFAULT \'\', postal_code VARCHAR(255) DEFAULT \'\', locality VARCHAR(255) DEFAULT \'\', user_agent VARCHAR(255) DEFAULT \'\', referrer VARCHAR(255) DEFAULT \'\', INDEX IDX_D9945A6EBAD26311 (tag_id), INDEX IDX_D9945A6E812D5EB (extension_id), INDEX IDX_D9945A6E3EB8070A (program_id), INDEX IDX_D9945A6E7140A621 (rec_from_program_id), INDEX IDX_D9945A6EA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); + $this->addSql('CREATE TABLE click_statistics (id INT AUTO_INCREMENT NOT NULL, tag_id INT DEFAULT NULL, extension_id INT DEFAULT NULL, project_id INT DEFAULT NULL, rec_from_project_id INT DEFAULT NULL, user_id INT DEFAULT NULL, type LONGTEXT NOT NULL, clicked_at DATETIME NOT NULL, ip LONGTEXT NOT NULL, latitude LONGTEXT DEFAULT NULL, longitude LONGTEXT DEFAULT NULL, country_code LONGTEXT DEFAULT NULL, country_name LONGTEXT DEFAULT NULL, street VARCHAR(255) DEFAULT \'\', postal_code VARCHAR(255) DEFAULT \'\', locality VARCHAR(255) DEFAULT \'\', user_agent VARCHAR(255) DEFAULT \'\', referrer VARCHAR(255) DEFAULT \'\', INDEX IDX_D9945A6EBAD26311 (tag_id), INDEX IDX_D9945A6E812D5EB (extension_id), INDEX IDX_D9945A6E3EB8070A (project_id), INDEX IDX_D9945A6E7140A621 (rec_from_project_id), INDEX IDX_D9945A6EA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6EBAD26311 FOREIGN KEY (tag_id) REFERENCES tags (id)'); $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E812D5EB FOREIGN KEY (extension_id) REFERENCES extension (id)'); - $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E3EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E7140A621 FOREIGN KEY (rec_from_program_id) REFERENCES program (id)'); + $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E3EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E7140A621 FOREIGN KEY (rec_from_project_id) REFERENCES project (id)'); $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6EA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE program_downloads ADD rec_from_program_id INT DEFAULT NULL'); - $this->addSql('ALTER TABLE program_downloads ADD CONSTRAINT FK_1D41556A7140A621 FOREIGN KEY (rec_from_program_id) REFERENCES program (id)'); - $this->addSql('CREATE INDEX IDX_1D41556A7140A621 ON program_downloads (rec_from_program_id)'); + $this->addSql('ALTER TABLE project_downloads ADD rec_from_project_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE project_downloads ADD CONSTRAINT FK_1D41556A7140A621 FOREIGN KEY (rec_from_project_id) REFERENCES project (id)'); + $this->addSql('CREATE INDEX IDX_1D41556A7140A621 ON project_downloads (rec_from_project_id)'); } /** @@ -38,8 +38,8 @@ public function down(Schema $schema): void $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('DROP TABLE click_statistics'); - $this->addSql('ALTER TABLE program_downloads DROP FOREIGN KEY FK_1D41556A7140A621'); - $this->addSql('DROP INDEX IDX_1D41556A7140A621 ON program_downloads'); - $this->addSql('ALTER TABLE program_downloads DROP rec_from_program_id'); + $this->addSql('ALTER TABLE project_downloads DROP FOREIGN KEY FK_1D41556A7140A621'); + $this->addSql('DROP INDEX IDX_1D41556A7140A621 ON project_downloads'); + $this->addSql('ALTER TABLE project_downloads DROP rec_from_project_id'); } } diff --git a/migrations/2017/Version20170205070355.php b/migrations/2017/Version20170205070355.php index 7de082b148..4604be0a66 100644 --- a/migrations/2017/Version20170205070355.php +++ b/migrations/2017/Version20170205070355.php @@ -18,10 +18,10 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program_downloads ADD recommended_by_program_id INT DEFAULT NULL, ADD recommended_by_page_id INT DEFAULT NULL'); - $this->addSql('ALTER TABLE program_downloads ADD CONSTRAINT FK_1D41556A1748903F FOREIGN KEY (recommended_by_program_id) REFERENCES program (id)'); - $this->addSql('CREATE INDEX IDX_1D41556A1748903F ON program_downloads (recommended_by_program_id)'); - $this->addSql('ALTER TABLE click_statistics ADD scratch_program_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE project_downloads ADD recommended_by_project_id INT DEFAULT NULL, ADD recommended_by_page_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE project_downloads ADD CONSTRAINT FK_1D41556A1748903F FOREIGN KEY (recommended_by_project_id) REFERENCES project (id)'); + $this->addSql('CREATE INDEX IDX_1D41556A1748903F ON project_downloads (recommended_by_project_id)'); + $this->addSql('ALTER TABLE click_statistics ADD scratch_project_id INT DEFAULT NULL'); } /** @@ -32,9 +32,9 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE click_statistics DROP scratch_program_id'); - $this->addSql('ALTER TABLE program_downloads DROP FOREIGN KEY FK_1D41556A1748903F'); - $this->addSql('DROP INDEX IDX_1D41556A1748903F ON program_downloads'); - $this->addSql('ALTER TABLE program_downloads DROP recommended_by_program_id, DROP recommended_by_page_id'); + $this->addSql('ALTER TABLE click_statistics DROP scratch_project_id'); + $this->addSql('ALTER TABLE project_downloads DROP FOREIGN KEY FK_1D41556A1748903F'); + $this->addSql('DROP INDEX IDX_1D41556A1748903F ON project_downloads'); + $this->addSql('ALTER TABLE project_downloads DROP recommended_by_project_id, DROP recommended_by_page_id'); } } diff --git a/migrations/2017/Version20170205230019.php b/migrations/2017/Version20170205230019.php index 9fad71780c..5adc2065ef 100644 --- a/migrations/2017/Version20170205230019.php +++ b/migrations/2017/Version20170205230019.php @@ -18,9 +18,9 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('CREATE TABLE program_like (program_id INT NOT NULL, user_id INT NOT NULL, type INT DEFAULT 0 NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_A18515B43EB8070A (program_id), INDEX IDX_A18515B4A76ED395 (user_id), PRIMARY KEY(program_id, user_id, type)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('ALTER TABLE program_like ADD CONSTRAINT FK_A18515B43EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program_like ADD CONSTRAINT FK_A18515B4A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); + $this->addSql('CREATE TABLE project_like (project_id INT NOT NULL, user_id INT NOT NULL, type INT DEFAULT 0 NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_A18515B43EB8070A (project_id), INDEX IDX_A18515B4A76ED395 (user_id), PRIMARY KEY(project_id, user_id, type)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); + $this->addSql('ALTER TABLE project_like ADD CONSTRAINT FK_A18515B43EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project_like ADD CONSTRAINT FK_A18515B4A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); } /** @@ -31,6 +31,6 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('DROP TABLE program_like'); + $this->addSql('DROP TABLE project_like'); } } diff --git a/migrations/2017/Version20170208212708.php b/migrations/2017/Version20170208212708.php index 290f46f15c..2021cfa932 100644 --- a/migrations/2017/Version20170208212708.php +++ b/migrations/2017/Version20170208212708.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program_downloads ADD locale VARCHAR(255) DEFAULT \'\''); + $this->addSql('ALTER TABLE project_downloads ADD locale VARCHAR(255) DEFAULT \'\''); $this->addSql('ALTER TABLE click_statistics ADD locale VARCHAR(255) DEFAULT \'\''); } @@ -31,6 +31,6 @@ public function down(Schema $schema): void $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE click_statistics DROP locale'); - $this->addSql('ALTER TABLE program_downloads DROP locale'); + $this->addSql('ALTER TABLE project_downloads DROP locale'); } } diff --git a/migrations/2017/Version20170222111928.php b/migrations/2017/Version20170222111928.php index c0a6ef0887..281d9a18f2 100644 --- a/migrations/2017/Version20170222111928.php +++ b/migrations/2017/Version20170222111928.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program_downloads CHANGE locale locale VARCHAR(255) DEFAULT NULL'); + $this->addSql('ALTER TABLE project_downloads CHANGE locale locale VARCHAR(255) DEFAULT NULL'); $this->addSql('ALTER TABLE click_statistics CHANGE locale locale VARCHAR(255) DEFAULT NULL'); } @@ -31,6 +31,6 @@ public function down(Schema $schema): void $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE click_statistics CHANGE locale locale VARCHAR(255) DEFAULT \'\' COLLATE utf8_unicode_ci'); - $this->addSql('ALTER TABLE program_downloads CHANGE locale locale VARCHAR(255) DEFAULT \'\' COLLATE utf8_unicode_ci'); + $this->addSql('ALTER TABLE project_downloads CHANGE locale locale VARCHAR(255) DEFAULT \'\' COLLATE utf8_unicode_ci'); } } diff --git a/migrations/2017/Version20170226222917.php b/migrations/2017/Version20170226222917.php index 82971d433a..58b40c523c 100644 --- a/migrations/2017/Version20170226222917.php +++ b/migrations/2017/Version20170226222917.php @@ -20,14 +20,14 @@ public function up(Schema $schema): void $this->addSql('CREATE TABLE user_like_similarity_relation (first_user_id INT NOT NULL, second_user_id INT NOT NULL, similarity NUMERIC(4, 3) DEFAULT \'0\' NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_132DCA08B4E2BF69 (first_user_id), INDEX IDX_132DCA08B02C53F8 (second_user_id), PRIMARY KEY(first_user_id, second_user_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE user_remix_similarity_relation (first_user_id INT NOT NULL, second_user_id INT NOT NULL, similarity NUMERIC(4, 3) DEFAULT \'0\' NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_143F09C7B4E2BF69 (first_user_id), INDEX IDX_143F09C7B02C53F8 (second_user_id), PRIMARY KEY(first_user_id, second_user_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE homepage_click_statistics (id INT AUTO_INCREMENT NOT NULL, program_id INT DEFAULT NULL, user_id INT DEFAULT NULL, type LONGTEXT NOT NULL, clicked_at DATETIME NOT NULL, ip LONGTEXT NOT NULL, locale VARCHAR(255) DEFAULT NULL, user_agent VARCHAR(255) DEFAULT \'\', referrer VARCHAR(255) DEFAULT \'\', INDEX IDX_99AECB2F3EB8070A (program_id), INDEX IDX_99AECB2FA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); + $this->addSql('CREATE TABLE homepage_click_statistics (id INT AUTO_INCREMENT NOT NULL, project_id INT DEFAULT NULL, user_id INT DEFAULT NULL, type LONGTEXT NOT NULL, clicked_at DATETIME NOT NULL, ip LONGTEXT NOT NULL, locale VARCHAR(255) DEFAULT NULL, user_agent VARCHAR(255) DEFAULT \'\', referrer VARCHAR(255) DEFAULT \'\', INDEX IDX_99AECB2F3EB8070A (project_id), INDEX IDX_99AECB2FA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('ALTER TABLE user_like_similarity_relation ADD CONSTRAINT FK_132DCA08B4E2BF69 FOREIGN KEY (first_user_id) REFERENCES fos_user (id)'); $this->addSql('ALTER TABLE user_like_similarity_relation ADD CONSTRAINT FK_132DCA08B02C53F8 FOREIGN KEY (second_user_id) REFERENCES fos_user (id)'); $this->addSql('ALTER TABLE user_remix_similarity_relation ADD CONSTRAINT FK_143F09C7B4E2BF69 FOREIGN KEY (first_user_id) REFERENCES fos_user (id)'); $this->addSql('ALTER TABLE user_remix_similarity_relation ADD CONSTRAINT FK_143F09C7B02C53F8 FOREIGN KEY (second_user_id) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE homepage_click_statistics ADD CONSTRAINT FK_99AECB2F3EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); + $this->addSql('ALTER TABLE homepage_click_statistics ADD CONSTRAINT FK_99AECB2F3EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); $this->addSql('ALTER TABLE homepage_click_statistics ADD CONSTRAINT FK_99AECB2FA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE program_downloads ADD user_specific_recommendation TINYINT(1) DEFAULT \'0\''); + $this->addSql('ALTER TABLE project_downloads ADD user_specific_recommendation TINYINT(1) DEFAULT \'0\''); $this->addSql('ALTER TABLE click_statistics ADD user_specific_recommendation TINYINT(1) DEFAULT \'0\''); } @@ -43,6 +43,6 @@ public function down(Schema $schema): void $this->addSql('DROP TABLE user_remix_similarity_relation'); $this->addSql('DROP TABLE homepage_click_statistics'); $this->addSql('ALTER TABLE click_statistics DROP user_specific_recommendation'); - $this->addSql('ALTER TABLE program_downloads DROP user_specific_recommendation'); + $this->addSql('ALTER TABLE project_downloads DROP user_specific_recommendation'); } } diff --git a/migrations/2017/Version20170307193316.php b/migrations/2017/Version20170307193316.php index 9b6d2021b9..0d2e9cc0dc 100644 --- a/migrations/2017/Version20170307193316.php +++ b/migrations/2017/Version20170307193316.php @@ -18,8 +18,8 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('CREATE TABLE nolb_example_program (id INT AUTO_INCREMENT NOT NULL, program_id INT DEFAULT NULL, active TINYINT(1) NOT NULL, is_for_female TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_66FFF6983EB8070A (program_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('ALTER TABLE nolb_example_program ADD CONSTRAINT FK_66FFF6983EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); + $this->addSql('CREATE TABLE nolb_example_project (id INT AUTO_INCREMENT NOT NULL, project_id INT DEFAULT NULL, active TINYINT(1) NOT NULL, is_for_female TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_66FFF6983EB8070A (project_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); + $this->addSql('ALTER TABLE nolb_example_project ADD CONSTRAINT FK_66FFF6983EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); } /** @@ -30,6 +30,6 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('DROP TABLE nolb_example_program'); + $this->addSql('DROP TABLE nolb_example_project'); } } diff --git a/migrations/2017/Version20170309173506.php b/migrations/2017/Version20170309173506.php index a364dc5b50..23c1df3c30 100644 --- a/migrations/2017/Version20170309173506.php +++ b/migrations/2017/Version20170309173506.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE nolb_example_program ADD downloads_from_male INT NOT NULL, ADD downloads_from_female INT NOT NULL'); + $this->addSql('ALTER TABLE nolb_example_project ADD downloads_from_male INT NOT NULL, ADD downloads_from_female INT NOT NULL'); } /** @@ -29,6 +29,6 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE nolb_example_program DROP downloads_from_male, DROP downloads_from_female'); + $this->addSql('ALTER TABLE nolb_example_project DROP downloads_from_male, DROP downloads_from_female'); } } diff --git a/migrations/2017/Version20170924003417.php b/migrations/2017/Version20170924003417.php index b48f217e63..b9d80540e5 100644 --- a/migrations/2017/Version20170924003417.php +++ b/migrations/2017/Version20170924003417.php @@ -18,21 +18,21 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program_downloads DROP FOREIGN KEY FK_1D41556AA76ED395'); - $this->addSql('ALTER TABLE program_downloads ADD CONSTRAINT FK_1D41556AA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE project_downloads DROP FOREIGN KEY FK_1D41556AA76ED395'); + $this->addSql('ALTER TABLE project_downloads ADD CONSTRAINT FK_1D41556AA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE click_statistics DROP FOREIGN KEY FK_D9945A6E3EB8070A'); $this->addSql('ALTER TABLE click_statistics DROP FOREIGN KEY FK_D9945A6E7140A621'); $this->addSql('ALTER TABLE click_statistics DROP FOREIGN KEY FK_D9945A6EA76ED395'); - $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E3EB8070A FOREIGN KEY (program_id) REFERENCES program (id) ON DELETE SET NULL'); - $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E7140A621 FOREIGN KEY (rec_from_program_id) REFERENCES program (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E3EB8070A FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E7140A621 FOREIGN KEY (rec_from_project_id) REFERENCES project (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6EA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE SET NULL'); - $this->addSql('ALTER TABLE ProgramInappropriateReport DROP FOREIGN KEY FK_ED2222483EB8070A'); - $this->addSql('ALTER TABLE ProgramInappropriateReport DROP FOREIGN KEY FK_ED222248A76ED395'); - $this->addSql('ALTER TABLE ProgramInappropriateReport ADD CONSTRAINT FK_ED2222483EB8070A FOREIGN KEY (program_id) REFERENCES program (id) ON DELETE SET NULL'); - $this->addSql('ALTER TABLE ProgramInappropriateReport ADD CONSTRAINT FK_ED222248A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE ProjectInappropriateReport DROP FOREIGN KEY FK_ED2222483EB8070A'); + $this->addSql('ALTER TABLE ProjectInappropriateReport DROP FOREIGN KEY FK_ED222248A76ED395'); + $this->addSql('ALTER TABLE ProjectInappropriateReport ADD CONSTRAINT FK_ED2222483EB8070A FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE ProjectInappropriateReport ADD CONSTRAINT FK_ED222248A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE homepage_click_statistics DROP FOREIGN KEY FK_99AECB2F3EB8070A'); $this->addSql('ALTER TABLE homepage_click_statistics DROP FOREIGN KEY FK_99AECB2FA76ED395'); - $this->addSql('ALTER TABLE homepage_click_statistics ADD CONSTRAINT FK_99AECB2F3EB8070A FOREIGN KEY (program_id) REFERENCES program (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE homepage_click_statistics ADD CONSTRAINT FK_99AECB2F3EB8070A FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE homepage_click_statistics ADD CONSTRAINT FK_99AECB2FA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE SET NULL'); } @@ -44,21 +44,21 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE ProgramInappropriateReport DROP FOREIGN KEY FK_ED222248A76ED395'); - $this->addSql('ALTER TABLE ProgramInappropriateReport DROP FOREIGN KEY FK_ED2222483EB8070A'); - $this->addSql('ALTER TABLE ProgramInappropriateReport ADD CONSTRAINT FK_ED222248A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE ProgramInappropriateReport ADD CONSTRAINT FK_ED2222483EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); + $this->addSql('ALTER TABLE ProjectInappropriateReport DROP FOREIGN KEY FK_ED222248A76ED395'); + $this->addSql('ALTER TABLE ProjectInappropriateReport DROP FOREIGN KEY FK_ED2222483EB8070A'); + $this->addSql('ALTER TABLE ProjectInappropriateReport ADD CONSTRAINT FK_ED222248A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); + $this->addSql('ALTER TABLE ProjectInappropriateReport ADD CONSTRAINT FK_ED2222483EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); $this->addSql('ALTER TABLE click_statistics DROP FOREIGN KEY FK_D9945A6E3EB8070A'); $this->addSql('ALTER TABLE click_statistics DROP FOREIGN KEY FK_D9945A6E7140A621'); $this->addSql('ALTER TABLE click_statistics DROP FOREIGN KEY FK_D9945A6EA76ED395'); - $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E3EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E7140A621 FOREIGN KEY (rec_from_program_id) REFERENCES program (id)'); + $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E3EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E7140A621 FOREIGN KEY (rec_from_project_id) REFERENCES project (id)'); $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6EA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); $this->addSql('ALTER TABLE homepage_click_statistics DROP FOREIGN KEY FK_99AECB2F3EB8070A'); $this->addSql('ALTER TABLE homepage_click_statistics DROP FOREIGN KEY FK_99AECB2FA76ED395'); - $this->addSql('ALTER TABLE homepage_click_statistics ADD CONSTRAINT FK_99AECB2F3EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); + $this->addSql('ALTER TABLE homepage_click_statistics ADD CONSTRAINT FK_99AECB2F3EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); $this->addSql('ALTER TABLE homepage_click_statistics ADD CONSTRAINT FK_99AECB2FA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE program_downloads DROP FOREIGN KEY FK_1D41556AA76ED395'); - $this->addSql('ALTER TABLE program_downloads ADD CONSTRAINT FK_1D41556AA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); + $this->addSql('ALTER TABLE project_downloads DROP FOREIGN KEY FK_1D41556AA76ED395'); + $this->addSql('ALTER TABLE project_downloads ADD CONSTRAINT FK_1D41556AA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); } } diff --git a/migrations/2017/Version20171102163055.php b/migrations/2017/Version20171102163055.php index f32b553dc3..e3dbccbd8a 100644 --- a/migrations/2017/Version20171102163055.php +++ b/migrations/2017/Version20171102163055.php @@ -18,9 +18,9 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE user_comment ADD programs INT DEFAULT NULL'); - $this->addSql('ALTER TABLE user_comment ADD CONSTRAINT FK_CC794C66F1496545 FOREIGN KEY (programs) REFERENCES program (id)'); - $this->addSql('CREATE INDEX IDX_CC794C66F1496545 ON user_comment (programs)'); + $this->addSql('ALTER TABLE user_comment ADD projects INT DEFAULT NULL'); + $this->addSql('ALTER TABLE user_comment ADD CONSTRAINT FK_CC794C66F1496545 FOREIGN KEY (projects) REFERENCES project (id)'); + $this->addSql('CREATE INDEX IDX_CC794C66F1496545 ON user_comment (projects)'); } /** @@ -33,6 +33,6 @@ public function down(Schema $schema): void $this->addSql('ALTER TABLE user_comment DROP FOREIGN KEY FK_CC794C66F1496545'); $this->addSql('DROP INDEX IDX_CC794C66F1496545 ON user_comment'); - $this->addSql('ALTER TABLE user_comment DROP programs'); + $this->addSql('ALTER TABLE user_comment DROP projects'); } } diff --git a/migrations/2018/Version20180525064111.php b/migrations/2018/Version20180525064111.php index ea9ba220f1..a5192466ba 100644 --- a/migrations/2018/Version20180525064111.php +++ b/migrations/2018/Version20180525064111.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program_downloads DROP latitude, DROP longitude, DROP street, DROP postal_code, DROP locality'); + $this->addSql('ALTER TABLE project_downloads DROP latitude, DROP longitude, DROP street, DROP postal_code, DROP locality'); $this->addSql('ALTER TABLE click_statistics DROP latitude, DROP longitude, DROP street, DROP postal_code, DROP locality'); } @@ -31,6 +31,6 @@ public function down(Schema $schema): void $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE click_statistics ADD latitude LONGTEXT DEFAULT NULL COLLATE utf8_unicode_ci, ADD longitude LONGTEXT DEFAULT NULL COLLATE utf8_unicode_ci, ADD street VARCHAR(255) DEFAULT \'\' COLLATE utf8_unicode_ci, ADD postal_code VARCHAR(255) DEFAULT \'\' COLLATE utf8_unicode_ci, ADD locality VARCHAR(255) DEFAULT \'\' COLLATE utf8_unicode_ci'); - $this->addSql('ALTER TABLE program_downloads ADD latitude LONGTEXT DEFAULT NULL COLLATE utf8_unicode_ci, ADD longitude LONGTEXT DEFAULT NULL COLLATE utf8_unicode_ci, ADD street VARCHAR(255) DEFAULT \'\' COLLATE utf8_unicode_ci, ADD postal_code VARCHAR(255) DEFAULT \'\' COLLATE utf8_unicode_ci, ADD locality VARCHAR(255) DEFAULT \'\' COLLATE utf8_unicode_ci'); + $this->addSql('ALTER TABLE project_downloads ADD latitude LONGTEXT DEFAULT NULL COLLATE utf8_unicode_ci, ADD longitude LONGTEXT DEFAULT NULL COLLATE utf8_unicode_ci, ADD street VARCHAR(255) DEFAULT \'\' COLLATE utf8_unicode_ci, ADD postal_code VARCHAR(255) DEFAULT \'\' COLLATE utf8_unicode_ci, ADD locality VARCHAR(255) DEFAULT \'\' COLLATE utf8_unicode_ci'); } } diff --git a/migrations/2018/Version20180801102210.php b/migrations/2018/Version20180801102210.php index 3cda656f3f..d67098160c 100644 --- a/migrations/2018/Version20180801102210.php +++ b/migrations/2018/Version20180801102210.php @@ -18,7 +18,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE ProgramInappropriateReport ADD category LONGTEXT NOT NULL'); + $this->addSql('ALTER TABLE ProjectInappropriateReport ADD category LONGTEXT NOT NULL'); } /** @@ -29,6 +29,6 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE ProgramInappropriateReport DROP category'); + $this->addSql('ALTER TABLE ProjectInappropriateReport DROP category'); } } diff --git a/migrations/2018/Version20180803175251.php b/migrations/2018/Version20180803175251.php index 8ba08c370d..5dd39f7e1f 100644 --- a/migrations/2018/Version20180803175251.php +++ b/migrations/2018/Version20180803175251.php @@ -18,11 +18,11 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' != $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE CatroNotification ADD like_from INT DEFAULT NULL, ADD program_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE CatroNotification ADD like_from INT DEFAULT NULL, ADD project_id INT DEFAULT NULL'); $this->addSql('ALTER TABLE CatroNotification ADD CONSTRAINT FK_22087FCA606F7D0E FOREIGN KEY (like_from) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE CatroNotification ADD CONSTRAINT FK_22087FCA3EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); + $this->addSql('ALTER TABLE CatroNotification ADD CONSTRAINT FK_22087FCA3EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); $this->addSql('CREATE INDEX IDX_22087FCA606F7D0E ON CatroNotification (like_from)'); - $this->addSql('CREATE INDEX IDX_22087FCA3EB8070A ON CatroNotification (program_id)'); + $this->addSql('CREATE INDEX IDX_22087FCA3EB8070A ON CatroNotification (project_id)'); } /** @@ -37,6 +37,6 @@ public function down(Schema $schema): void $this->addSql('ALTER TABLE CatroNotification DROP FOREIGN KEY FK_22087FCA3EB8070A'); $this->addSql('DROP INDEX IDX_22087FCA606F7D0E ON CatroNotification'); $this->addSql('DROP INDEX IDX_22087FCA3EB8070A ON CatroNotification'); - $this->addSql('ALTER TABLE CatroNotification DROP like_from, DROP program_id'); + $this->addSql('ALTER TABLE CatroNotification DROP like_from, DROP project_id'); } } diff --git a/migrations/2019/Version20190313084056.php b/migrations/2019/Version20190313084056.php index 8e7d3768aa..99cb63c1c5 100644 --- a/migrations/2019/Version20190313084056.php +++ b/migrations/2019/Version20190313084056.php @@ -24,30 +24,30 @@ public function up(Schema $schema): void $this->addSql('ALTER TABLE CatroNotification CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE GameJam CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE Notification CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE ProgramInappropriateReport CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE ProjectInappropriateReport CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE click_statistics CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE extension CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE featured CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE fos_user CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE fos_user_group CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE fos_user_user_group CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE gamejams_sampleprograms CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE gamejams_sampleprojects CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE homepage_click_statistics CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE media_package CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE media_package_category CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE media_package_file CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE mediapackagecategory_mediapackage CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE nolb_example_program CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program_downloads CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program_extension CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program_like CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program_remix_backward_relation CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program_remix_relation CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program_tag CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE nolb_example_project CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project_downloads CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project_extension CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project_like CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project_remix_backward_relation CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project_remix_relation CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project_tag CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE rudewords CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE scratch_program CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE scratch_program_remix_relation CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE scratch_project CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE scratch_project_remix_relation CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE starter_category CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE tags CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE template CONVERT TO CHARACTER SET utf8mb4 collate utf8mb4_unicode_ci'); @@ -62,31 +62,31 @@ public function down(Schema $schema): void $this->addSql('ALTER TABLE CatroNotification CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE GameJam CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE Notification CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE ProgramInappropriateReport CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE ProjectInappropriateReport CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE click_statistics CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE extension CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE featured CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE fos_user CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE fos_user_group CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE fos_user_user_group CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE gamejams_sampleprograms CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE gamejams_sampleprojects CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE homepage_click_statistics CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE media_package CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE media_package_category CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE media_package_file CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE mediapackagecategory_mediapackage CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE migration_versions CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE nolb_example_program CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program_downloads CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program_extension CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program_like CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program_remix_backward_relation CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program_remix_relation CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program_tag CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE nolb_example_project CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project_downloads CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project_extension CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project_like CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project_remix_backward_relation CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project_remix_relation CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project_tag CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE rudewords CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE scratch_program CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE scratch_program_remix_relation CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE scratch_project CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE scratch_project_remix_relation CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE starter_category CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE tags CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE template CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci collate utf8mb4_unicode_ci'); diff --git a/migrations/2019/Version20190313173221.php b/migrations/2019/Version20190313173221.php index 35fe6e1b35..012f0f8217 100644 --- a/migrations/2019/Version20190313173221.php +++ b/migrations/2019/Version20190313173221.php @@ -22,7 +22,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('DROP TABLE nolb_example_program'); + $this->addSql('DROP TABLE nolb_example_project'); $this->addSql('ALTER TABLE fos_user DROP nolb_user'); $this->addSql('ALTER TABLE acl_classes CHANGE id id INT UNSIGNED AUTO_INCREMENT NOT NULL'); $this->addSql('ALTER TABLE acl_security_identities CHANGE id id INT UNSIGNED AUTO_INCREMENT NOT NULL'); @@ -35,8 +35,8 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('CREATE TABLE nolb_example_program (id INT AUTO_INCREMENT NOT NULL, program_id INT DEFAULT NULL, active TINYINT(1) NOT NULL, is_for_female TINYINT(1) NOT NULL, downloads_from_male INT NOT NULL, downloads_from_female INT NOT NULL, UNIQUE INDEX UNIQ_66FFF6983EB8070A (program_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB COMMENT = \'\' '); - $this->addSql('ALTER TABLE nolb_example_program ADD CONSTRAINT FK_66FFF6983EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); + $this->addSql('CREATE TABLE nolb_example_project (id INT AUTO_INCREMENT NOT NULL, project_id INT DEFAULT NULL, active TINYINT(1) NOT NULL, is_for_female TINYINT(1) NOT NULL, downloads_from_male INT NOT NULL, downloads_from_female INT NOT NULL, UNIQUE INDEX UNIQ_66FFF6983EB8070A (project_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB COMMENT = \'\' '); + $this->addSql('ALTER TABLE nolb_example_project ADD CONSTRAINT FK_66FFF6983EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); $this->addSql('ALTER TABLE acl_classes CHANGE id id INT UNSIGNED AUTO_INCREMENT NOT NULL'); $this->addSql('ALTER TABLE acl_entries CHANGE id id INT UNSIGNED AUTO_INCREMENT NOT NULL'); $this->addSql('ALTER TABLE acl_object_identities CHANGE id id INT UNSIGNED AUTO_INCREMENT NOT NULL'); diff --git a/migrations/2019/Version20190519174116.php b/migrations/2019/Version20190519174116.php index c3fc97a43a..4e97133707 100644 --- a/migrations/2019/Version20190519174116.php +++ b/migrations/2019/Version20190519174116.php @@ -22,7 +22,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program ADD debug_build TINYINT(1) DEFAULT \'0\' NOT NULL'); + $this->addSql('ALTER TABLE project ADD debug_build TINYINT(1) DEFAULT \'0\' NOT NULL'); } public function down(Schema $schema): void @@ -30,6 +30,6 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program DROP debug_build'); + $this->addSql('ALTER TABLE project DROP debug_build'); } } diff --git a/migrations/2019/Version20190722143415.php b/migrations/2019/Version20190722143415.php index 96b5aef0fb..13ead69e9e 100644 --- a/migrations/2019/Version20190722143415.php +++ b/migrations/2019/Version20190722143415.php @@ -22,22 +22,22 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program DROP IF EXISTS fb_post_id, DROP IF EXISTS fb_post_url, CHANGE approved_by_user approved_by_user INT DEFAULT NULL, CHANGE category_id category_id INT DEFAULT NULL, CHANGE gamejam_id gamejam_id INT DEFAULT NULL, CHANGE directory_hash directory_hash VARCHAR(255) DEFAULT NULL, CHANGE catrobat_version_name catrobat_version_name VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE upload_ip upload_ip VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL, CHANGE upload_language upload_language VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE apk_request_time apk_request_time DATETIME DEFAULT NULL, CHANGE gamejam_submission_date gamejam_submission_date DATETIME DEFAULT NULL, CHANGE remix_migrated_at remix_migrated_at DATETIME DEFAULT NULL'); + $this->addSql('ALTER TABLE project DROP IF EXISTS fb_post_id, DROP IF EXISTS fb_post_url, CHANGE approved_by_user approved_by_user INT DEFAULT NULL, CHANGE category_id category_id INT DEFAULT NULL, CHANGE gamejam_id gamejam_id INT DEFAULT NULL, CHANGE directory_hash directory_hash VARCHAR(255) DEFAULT NULL, CHANGE catrobat_version_name catrobat_version_name VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE upload_ip upload_ip VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL, CHANGE upload_language upload_language VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE apk_request_time apk_request_time DATETIME DEFAULT NULL, CHANGE gamejam_submission_date gamejam_submission_date DATETIME DEFAULT NULL, CHANGE remix_migrated_at remix_migrated_at DATETIME DEFAULT NULL'); $this->addSql('ALTER TABLE fos_user DROP IF EXISTS facebook_access_token, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data JSON DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data JSON DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data JSON DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL, CHANGE upload_token upload_token VARCHAR(300) DEFAULT NULL, CHANGE country country VARCHAR(5) DEFAULT \'\' NOT NULL, CHANGE additional_email additional_email VARCHAR(255) DEFAULT NULL, CHANGE gplus_access_token gplus_access_token VARCHAR(300) DEFAULT NULL, CHANGE gplus_id_token gplus_id_token VARCHAR(5000) DEFAULT NULL, CHANGE gplus_refresh_token gplus_refresh_token VARCHAR(300) DEFAULT NULL, CHANGE dn dn VARCHAR(255) DEFAULT NULL'); $this->addSql('ALTER TABLE tags CHANGE en en VARCHAR(255) DEFAULT NULL, CHANGE de de VARCHAR(255) DEFAULT NULL, CHANGE it it VARCHAR(255) DEFAULT NULL, CHANGE fr fr VARCHAR(255) DEFAULT NULL'); $this->addSql('ALTER TABLE extension CHANGE name name VARCHAR(255) DEFAULT NULL, CHANGE prefix prefix VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE program_remix_relation CHANGE seen_at seen_at DATETIME DEFAULT NULL'); - $this->addSql('ALTER TABLE program_remix_backward_relation CHANGE seen_at seen_at DATETIME DEFAULT NULL'); + $this->addSql('ALTER TABLE project_remix_relation CHANGE seen_at seen_at DATETIME DEFAULT NULL'); + $this->addSql('ALTER TABLE project_remix_backward_relation CHANGE seen_at seen_at DATETIME DEFAULT NULL'); $this->addSql('ALTER TABLE GameJam CHANGE form_url form_url VARCHAR(300) DEFAULT NULL, CHANGE hashtag hashtag VARCHAR(100) DEFAULT NULL, CHANGE flavor flavor VARCHAR(100) DEFAULT NULL'); - $this->addSql('ALTER TABLE program_downloads CHANGE user_id user_id INT DEFAULT NULL, CHANGE rec_from_program_id rec_from_program_id INT DEFAULT NULL, CHANGE recommended_by_program_id recommended_by_program_id INT DEFAULT NULL, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\', CHANGE recommended_by_page_id recommended_by_page_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE scratch_program CHANGE name name VARCHAR(300) DEFAULT NULL'); - $this->addSql('ALTER TABLE click_statistics CHANGE tag_id tag_id INT DEFAULT NULL, CHANGE extension_id extension_id INT DEFAULT NULL, CHANGE program_id program_id INT DEFAULT NULL, CHANGE rec_from_program_id rec_from_program_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\', CHANGE scratch_program_id scratch_program_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE user_comment CHANGE programs programs INT DEFAULT NULL'); - $this->addSql('ALTER TABLE CatroNotification CHANGE comment_id comment_id INT DEFAULT NULL, CHANGE like_from like_from INT DEFAULT NULL, CHANGE program_id program_id INT DEFAULT NULL, CHANGE follower_id follower_id INT DEFAULT NULL'); - $this->addSql('ALTER TABLE featured CHANGE program_id program_id INT DEFAULT NULL, CHANGE url url VARCHAR(255) DEFAULT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL'); - $this->addSql('ALTER TABLE homepage_click_statistics CHANGE program_id program_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT NULL, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\''); + $this->addSql('ALTER TABLE project_downloads CHANGE user_id user_id INT DEFAULT NULL, CHANGE rec_from_project_id rec_from_project_id INT DEFAULT NULL, CHANGE recommended_by_project_id recommended_by_project_id INT DEFAULT NULL, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\', CHANGE recommended_by_page_id recommended_by_page_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT NULL'); + $this->addSql('ALTER TABLE scratch_project CHANGE name name VARCHAR(300) DEFAULT NULL'); + $this->addSql('ALTER TABLE click_statistics CHANGE tag_id tag_id INT DEFAULT NULL, CHANGE extension_id extension_id INT DEFAULT NULL, CHANGE project_id project_id INT DEFAULT NULL, CHANGE rec_from_project_id rec_from_project_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\', CHANGE scratch_project_id scratch_project_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT NULL'); + $this->addSql('ALTER TABLE user_comment CHANGE projects projects INT DEFAULT NULL'); + $this->addSql('ALTER TABLE CatroNotification CHANGE comment_id comment_id INT DEFAULT NULL, CHANGE like_from like_from INT DEFAULT NULL, CHANGE project_id project_id INT DEFAULT NULL, CHANGE follower_id follower_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE featured CHANGE project_id project_id INT DEFAULT NULL, CHANGE url url VARCHAR(255) DEFAULT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL'); + $this->addSql('ALTER TABLE homepage_click_statistics CHANGE project_id project_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT NULL, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\''); $this->addSql('ALTER TABLE media_package_file CHANGE category_id category_id INT DEFAULT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'pocketcode\', CHANGE author author VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE ProgramInappropriateReport CHANGE user_id user_id INT DEFAULT NULL, CHANGE program_id program_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE ProjectInappropriateReport CHANGE user_id user_id INT DEFAULT NULL, CHANGE project_id project_id INT DEFAULT NULL'); $this->addSql('ALTER TABLE acl_object_identities CHANGE parent_object_identity_id parent_object_identity_id INT UNSIGNED DEFAULT NULL'); $this->addSql('ALTER TABLE acl_entries CHANGE object_identity_id object_identity_id INT UNSIGNED DEFAULT NULL, CHANGE field_name field_name VARCHAR(50) DEFAULT NULL'); } @@ -47,23 +47,23 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE CatroNotification CHANGE comment_id comment_id INT DEFAULT NULL, CHANGE like_from like_from INT DEFAULT NULL, CHANGE program_id program_id INT DEFAULT NULL, CHANGE follower_id follower_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE CatroNotification CHANGE comment_id comment_id INT DEFAULT NULL, CHANGE like_from like_from INT DEFAULT NULL, CHANGE project_id project_id INT DEFAULT NULL, CHANGE follower_id follower_id INT DEFAULT NULL'); $this->addSql('ALTER TABLE GameJam CHANGE form_url form_url VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE hashtag hashtag VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE flavor flavor VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE ProgramInappropriateReport CHANGE user_id user_id INT DEFAULT NULL, CHANGE program_id program_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE ProjectInappropriateReport CHANGE user_id user_id INT DEFAULT NULL, CHANGE project_id project_id INT DEFAULT NULL'); $this->addSql('ALTER TABLE acl_entries CHANGE object_identity_id object_identity_id INT UNSIGNED DEFAULT NULL, CHANGE field_name field_name VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8_unicode_ci'); $this->addSql('ALTER TABLE acl_object_identities CHANGE parent_object_identity_id parent_object_identity_id INT UNSIGNED DEFAULT NULL'); - $this->addSql('ALTER TABLE click_statistics CHANGE tag_id tag_id INT DEFAULT NULL, CHANGE extension_id extension_id INT DEFAULT NULL, CHANGE program_id program_id INT DEFAULT NULL, CHANGE rec_from_program_id rec_from_program_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE scratch_program_id scratch_program_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE click_statistics CHANGE tag_id tag_id INT DEFAULT NULL, CHANGE extension_id extension_id INT DEFAULT NULL, CHANGE project_id project_id INT DEFAULT NULL, CHANGE rec_from_project_id rec_from_project_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE scratch_project_id scratch_project_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE extension CHANGE name name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE prefix prefix VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE featured CHANGE program_id program_id INT DEFAULT NULL, CHANGE url url VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE flavor flavor VARCHAR(255) DEFAULT \'\'pocketcode\'\' NOT NULL COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE featured CHANGE project_id project_id INT DEFAULT NULL, CHANGE url url VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE flavor flavor VARCHAR(255) DEFAULT \'\'pocketcode\'\' NOT NULL COLLATE utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE fos_user ADD facebook_access_token VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE salt salt VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE last_login last_login DATETIME DEFAULT \'NULL\', CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE password_requested_at password_requested_at DATETIME DEFAULT \'NULL\', CHANGE date_of_birth date_of_birth DATETIME DEFAULT \'NULL\', CHANGE firstname firstname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lastname lastname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE website website VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE biography biography VARCHAR(1000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gender gender VARCHAR(1) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE locale locale VARCHAR(8) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE timezone timezone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE phone phone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_data facebook_data JSON DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_data twitter_data JSON DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_data gplus_data JSON DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE upload_token upload_token VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE country country VARCHAR(5) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE additional_email additional_email VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE dn dn VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_access_token gplus_access_token VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_id_token gplus_id_token VARCHAR(5000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_refresh_token gplus_refresh_token VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE homepage_click_statistics CHANGE program_id program_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE homepage_click_statistics CHANGE project_id project_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE media_package_file CHANGE category_id category_id INT DEFAULT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'\'pocketcode\'\' COLLATE utf8mb4_unicode_ci, CHANGE author author VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program ADD fb_post_id VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, ADD fb_post_url VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE approved_by_user approved_by_user INT DEFAULT NULL, CHANGE category_id category_id INT DEFAULT NULL, CHANGE gamejam_id gamejam_id INT DEFAULT NULL, CHANGE directory_hash directory_hash VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE catrobat_version_name catrobat_version_name VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE upload_ip upload_ip VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE flavor flavor VARCHAR(255) DEFAULT \'\'pocketcode\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE upload_language upload_language VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE remix_migrated_at remix_migrated_at DATETIME DEFAULT \'NULL\', CHANGE apk_request_time apk_request_time DATETIME DEFAULT \'NULL\', CHANGE gamejam_submission_date gamejam_submission_date DATETIME DEFAULT \'NULL\''); - $this->addSql('ALTER TABLE program_downloads CHANGE recommended_by_program_id recommended_by_program_id INT DEFAULT NULL, CHANGE rec_from_program_id rec_from_program_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE recommended_by_page_id recommended_by_page_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program_remix_backward_relation CHANGE seen_at seen_at DATETIME DEFAULT \'NULL\''); - $this->addSql('ALTER TABLE program_remix_relation CHANGE seen_at seen_at DATETIME DEFAULT \'NULL\''); - $this->addSql('ALTER TABLE scratch_program CHANGE name name VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project ADD fb_post_id VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, ADD fb_post_url VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE approved_by_user approved_by_user INT DEFAULT NULL, CHANGE category_id category_id INT DEFAULT NULL, CHANGE gamejam_id gamejam_id INT DEFAULT NULL, CHANGE directory_hash directory_hash VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE catrobat_version_name catrobat_version_name VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE upload_ip upload_ip VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE flavor flavor VARCHAR(255) DEFAULT \'\'pocketcode\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE upload_language upload_language VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE remix_migrated_at remix_migrated_at DATETIME DEFAULT \'NULL\', CHANGE apk_request_time apk_request_time DATETIME DEFAULT \'NULL\', CHANGE gamejam_submission_date gamejam_submission_date DATETIME DEFAULT \'NULL\''); + $this->addSql('ALTER TABLE project_downloads CHANGE recommended_by_project_id recommended_by_project_id INT DEFAULT NULL, CHANGE rec_from_project_id rec_from_project_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE recommended_by_page_id recommended_by_page_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project_remix_backward_relation CHANGE seen_at seen_at DATETIME DEFAULT \'NULL\''); + $this->addSql('ALTER TABLE project_remix_relation CHANGE seen_at seen_at DATETIME DEFAULT \'NULL\''); + $this->addSql('ALTER TABLE scratch_project CHANGE name name VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE tags CHANGE en en VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE de de VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE it it VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE fr fr VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE user_comment CHANGE programs programs INT DEFAULT NULL'); + $this->addSql('ALTER TABLE user_comment CHANGE projects projects INT DEFAULT NULL'); } } diff --git a/migrations/2019/Version20190723093025.php b/migrations/2019/Version20190723093025.php index aa73a99b39..dd8f70106d 100644 --- a/migrations/2019/Version20190723093025.php +++ b/migrations/2019/Version20190723093025.php @@ -22,7 +22,7 @@ public function up(Schema $schema): void // this up() migration is not auto generated! $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - // deleting all user.id / program.id foreign keys to allow changing the type + // deleting all user.id / project.id foreign keys to allow changing the type $this->addSql('ALTER TABLE CatroNotification DROP FOREIGN KEY IF EXISTS FK_22087FCAAC24F853'); $this->addSql('ALTER TABLE CatroNotification DROP FOREIGN KEY IF EXISTS FK_22087FCA606F7D0E'); $this->addSql('ALTER TABLE CatroNotification DROP FOREIGN KEY IF EXISTS FK_22087FCA8D93D649'); @@ -30,29 +30,29 @@ public function up(Schema $schema): void $this->addSql('ALTER TABLE click_statistics DROP FOREIGN KEY IF EXISTS FK_D9945A6E3EB8070A'); $this->addSql('ALTER TABLE click_statistics DROP FOREIGN KEY IF EXISTS FK_D9945A6E7140A621'); $this->addSql('ALTER TABLE click_statistics DROP FOREIGN KEY IF EXISTS FK_D9945A6EA76ED395'); - $this->addSql('ALTER TABLE gamejams_sampleprograms DROP FOREIGN KEY IF EXISTS FK_8EADA1363EB8070A'); + $this->addSql('ALTER TABLE gamejams_sampleprojects DROP FOREIGN KEY IF EXISTS FK_8EADA1363EB8070A'); $this->addSql('ALTER TABLE homepage_click_statistics DROP FOREIGN KEY IF EXISTS FK_99AECB2F3EB8070A'); $this->addSql('ALTER TABLE homepage_click_statistics DROP FOREIGN KEY IF EXISTS FK_99AECB2FA76ED395'); $this->addSql('ALTER TABLE featured DROP FOREIGN KEY IF EXISTS FK_3C1359D43EB8070A'); $this->addSql('ALTER TABLE fos_user_user_group DROP FOREIGN KEY IF EXISTS FK_B3C77447A76ED395'); $this->addSql('ALTER TABLE Notification DROP FOREIGN KEY IF EXISTS FK_A765AD328D93D649'); - $this->addSql('ALTER TABLE program_downloads DROP FOREIGN KEY IF EXISTS FK_1D41556A1748903F'); - $this->addSql('ALTER TABLE program_downloads DROP FOREIGN KEY IF EXISTS FK_1D41556A3EB8070A'); - $this->addSql('ALTER TABLE program_downloads DROP FOREIGN KEY IF EXISTS FK_1D41556A7140A621'); - $this->addSql('ALTER TABLE program_extension DROP FOREIGN KEY IF EXISTS FK_C985CCA83EB8070A'); - $this->addSql('ALTER TABLE ProgramInappropriateReport DROP FOREIGN KEY IF EXISTS FK_ED222248A76ED395'); - $this->addSql('ALTER TABLE ProgramInappropriateReport DROP FOREIGN KEY IF EXISTS FK_ED2222483EB8070A'); - $this->addSql('ALTER TABLE program DROP FOREIGN KEY IF EXISTS FK_92ED77849D8F32D0'); - $this->addSql('ALTER TABLE program DROP FOREIGN KEY IF EXISTS FK_92ED7784A76ED395'); - $this->addSql('ALTER TABLE program_downloads DROP FOREIGN KEY IF EXISTS FK_1D41556AA76ED395'); - $this->addSql('ALTER TABLE program_like DROP FOREIGN KEY IF EXISTS FK_A18515B43EB8070A'); - $this->addSql('ALTER TABLE program_like DROP FOREIGN KEY IF EXISTS FK_A18515B4A76ED395'); - $this->addSql('ALTER TABLE program_remix_relation DROP FOREIGN KEY IF EXISTS FK_E5AD23B4C671CEA1'); - $this->addSql('ALTER TABLE program_remix_relation DROP FOREIGN KEY IF EXISTS FK_E5AD23B41844467D'); - $this->addSql('ALTER TABLE program_remix_backward_relation DROP FOREIGN KEY IF EXISTS FK_C294015B727ACA70'); - $this->addSql('ALTER TABLE program_remix_backward_relation DROP FOREIGN KEY IF EXISTS FK_C294015BDD62C21B'); - $this->addSql('ALTER TABLE program_tag DROP FOREIGN KEY IF EXISTS FK_88B68E093EB8070A'); - $this->addSql('ALTER TABLE scratch_program_remix_relation DROP FOREIGN KEY IF EXISTS FK_3B275E756F212B35'); + $this->addSql('ALTER TABLE project_downloads DROP FOREIGN KEY IF EXISTS FK_1D41556A1748903F'); + $this->addSql('ALTER TABLE project_downloads DROP FOREIGN KEY IF EXISTS FK_1D41556A3EB8070A'); + $this->addSql('ALTER TABLE project_downloads DROP FOREIGN KEY IF EXISTS FK_1D41556A7140A621'); + $this->addSql('ALTER TABLE project_extension DROP FOREIGN KEY IF EXISTS FK_C985CCA83EB8070A'); + $this->addSql('ALTER TABLE ProjectInappropriateReport DROP FOREIGN KEY IF EXISTS FK_ED222248A76ED395'); + $this->addSql('ALTER TABLE ProjectInappropriateReport DROP FOREIGN KEY IF EXISTS FK_ED2222483EB8070A'); + $this->addSql('ALTER TABLE project DROP FOREIGN KEY IF EXISTS FK_92ED77849D8F32D0'); + $this->addSql('ALTER TABLE project DROP FOREIGN KEY IF EXISTS FK_92ED7784A76ED395'); + $this->addSql('ALTER TABLE project_downloads DROP FOREIGN KEY IF EXISTS FK_1D41556AA76ED395'); + $this->addSql('ALTER TABLE project_like DROP FOREIGN KEY IF EXISTS FK_A18515B43EB8070A'); + $this->addSql('ALTER TABLE project_like DROP FOREIGN KEY IF EXISTS FK_A18515B4A76ED395'); + $this->addSql('ALTER TABLE project_remix_relation DROP FOREIGN KEY IF EXISTS FK_E5AD23B4C671CEA1'); + $this->addSql('ALTER TABLE project_remix_relation DROP FOREIGN KEY IF EXISTS FK_E5AD23B41844467D'); + $this->addSql('ALTER TABLE project_remix_backward_relation DROP FOREIGN KEY IF EXISTS FK_C294015B727ACA70'); + $this->addSql('ALTER TABLE project_remix_backward_relation DROP FOREIGN KEY IF EXISTS FK_C294015BDD62C21B'); + $this->addSql('ALTER TABLE project_tag DROP FOREIGN KEY IF EXISTS FK_88B68E093EB8070A'); + $this->addSql('ALTER TABLE scratch_project_remix_relation DROP FOREIGN KEY IF EXISTS FK_3B275E756F212B35'); $this->addSql('ALTER TABLE user_comment DROP FOREIGN KEY IF EXISTS FK_CC794C66F1496545'); $this->addSql('ALTER TABLE user_like_similarity_relation DROP FOREIGN KEY IF EXISTS FK_132DCA08B4E2BF69'); $this->addSql('ALTER TABLE user_like_similarity_relation DROP FOREIGN KEY IF EXISTS FK_132DCA08B02C53F8'); @@ -62,32 +62,32 @@ public function up(Schema $schema): void $this->addSql('ALTER TABLE user_user DROP FOREIGN KEY IF EXISTS FK_F7129A80233D34C1'); $this->addSql('DROP TABLE IF EXISTS user_user'); - // changing all integer id's for user and program to char36 guid types. - $this->addSql('ALTER TABLE CatroNotification CHANGE program_id program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + // changing all integer id's for user and project to char36 guid types. + $this->addSql('ALTER TABLE CatroNotification CHANGE project_id project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); $this->addSql('ALTER TABLE CatroNotification CHANGE user user CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', CHANGE like_from like_from CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE follower_id follower_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE click_statistics CHANGE program_id program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE rec_from_program_id rec_from_program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE click_statistics CHANGE project_id project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE rec_from_project_id rec_from_project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); $this->addSql('ALTER TABLE click_statistics CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE featured CHANGE program_id program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE featured CHANGE project_id project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); $this->addSql('ALTER TABLE fos_user CHANGE id id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); $this->addSql('ALTER TABLE fos_user_user_group CHANGE user_id user_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE homepage_click_statistics CHANGE program_id program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE homepage_click_statistics CHANGE project_id project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); $this->addSql('ALTER TABLE homepage_click_statistics CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE gamejams_sampleprograms CHANGE program_id program_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE gamejams_sampleprojects CHANGE project_id project_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); $this->addSql('ALTER TABLE Notification CHANGE user user CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE program CHANGE id id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE program CHANGE user_id user_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', CHANGE approved_by_user approved_by_user CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE program_tag CHANGE program_id program_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE program_downloads CHANGE program_id program_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', CHANGE rec_from_program_id rec_from_program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE recommended_by_program_id recommended_by_program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE program_downloads CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE program_extension CHANGE program_id program_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE ProgramInappropriateReport CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE ProgramInappropriateReport CHANGE program_id program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE program_like CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE program_like CHANGE program_id program_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE program_remix_relation CHANGE ancestor_id ancestor_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', CHANGE descendant_id descendant_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE program_remix_backward_relation CHANGE parent_id parent_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', CHANGE child_id child_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE scratch_program_remix_relation CHANGE scratch_parent_id scratch_parent_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', CHANGE catrobat_child_id catrobat_child_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE user_comment CHANGE programs programs CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE project CHANGE id id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE project CHANGE user_id user_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', CHANGE approved_by_user approved_by_user CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE project_tag CHANGE project_id project_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE project_downloads CHANGE project_id project_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', CHANGE rec_from_project_id rec_from_project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE recommended_by_project_id recommended_by_project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE project_downloads CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE project_extension CHANGE project_id project_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE ProjectInappropriateReport CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE ProjectInappropriateReport CHANGE project_id project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE project_like CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE project_like CHANGE project_id project_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE project_remix_relation CHANGE ancestor_id ancestor_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', CHANGE descendant_id descendant_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE project_remix_backward_relation CHANGE parent_id parent_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', CHANGE child_id child_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE scratch_project_remix_relation CHANGE scratch_parent_id scratch_parent_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', CHANGE catrobat_child_id catrobat_child_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE user_comment CHANGE projects projects CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); $this->addSql('ALTER TABLE user_like_similarity_relation CHANGE first_user_id first_user_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', CHANGE second_user_id second_user_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); $this->addSql('ALTER TABLE user_remix_similarity_relation CHANGE first_user_id first_user_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', CHANGE second_user_id second_user_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); @@ -98,37 +98,37 @@ public function up(Schema $schema): void $this->addSql('ALTER TABLE acl_entries CHANGE id id INT UNSIGNED AUTO_INCREMENT NOT NULL'); // recreating all foreign keys. - $this->addSql('ALTER TABLE CatroNotification ADD CONSTRAINT FK_22087FCA3EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); + $this->addSql('ALTER TABLE CatroNotification ADD CONSTRAINT FK_22087FCA3EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); $this->addSql('ALTER TABLE CatroNotification ADD CONSTRAINT FK_22087FCA606F7D0E FOREIGN KEY (like_from) REFERENCES fos_user (id)'); $this->addSql('ALTER TABLE CatroNotification ADD CONSTRAINT FK_22087FCA8D93D649 FOREIGN KEY (user) REFERENCES fos_user (id)'); $this->addSql('ALTER TABLE CatroNotification ADD CONSTRAINT FK_22087FCAAC24F853 FOREIGN KEY (follower_id) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E3EB8070A FOREIGN KEY (program_id) REFERENCES program (id) ON DELETE SET NULL'); - $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E7140A621 FOREIGN KEY (rec_from_program_id) REFERENCES program (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E3EB8070A FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E7140A621 FOREIGN KEY (rec_from_project_id) REFERENCES project (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6EA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE SET NULL'); - $this->addSql('ALTER TABLE featured ADD CONSTRAINT FK_3C1359D43EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); + $this->addSql('ALTER TABLE featured ADD CONSTRAINT FK_3C1359D43EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); $this->addSql('ALTER TABLE fos_user_user_group ADD CONSTRAINT FK_B3C77447A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE gamejams_sampleprograms ADD CONSTRAINT FK_8EADA1363EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); + $this->addSql('ALTER TABLE gamejams_sampleprojects ADD CONSTRAINT FK_8EADA1363EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); $this->addSql('ALTER TABLE homepage_click_statistics ADD CONSTRAINT FK_99AECB2FA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE homepage_click_statistics ADD CONSTRAINT FK_99AECB2F3EB8070A FOREIGN KEY (program_id) REFERENCES program (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE homepage_click_statistics ADD CONSTRAINT FK_99AECB2F3EB8070A FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE Notification ADD CONSTRAINT FK_A765AD328D93D649 FOREIGN KEY (user) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE program ADD CONSTRAINT FK_92ED77849D8F32D0 FOREIGN KEY (approved_by_user) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE program ADD CONSTRAINT FK_92ED7784A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE program_downloads ADD CONSTRAINT FK_1D41556AA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE SET NULL'); - $this->addSql('ALTER TABLE program_downloads ADD CONSTRAINT FK_1D41556A1748903F FOREIGN KEY (recommended_by_program_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program_downloads ADD CONSTRAINT FK_1D41556A3EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program_downloads ADD CONSTRAINT FK_1D41556A7140A621 FOREIGN KEY (rec_from_program_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program_extension ADD CONSTRAINT FK_C985CCA83EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE ProgramInappropriateReport ADD CONSTRAINT FK_ED222248A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE SET NULL'); - $this->addSql('ALTER TABLE ProgramInappropriateReport ADD CONSTRAINT FK_ED2222483EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program_like ADD CONSTRAINT FK_A18515B4A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE program_like ADD CONSTRAINT FK_A18515B43EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program_remix_backward_relation ADD CONSTRAINT FK_C294015B727ACA70 FOREIGN KEY (parent_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program_remix_backward_relation ADD CONSTRAINT FK_C294015BDD62C21B FOREIGN KEY (child_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program_remix_relation ADD CONSTRAINT FK_E5AD23B4C671CEA1 FOREIGN KEY (ancestor_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program_remix_relation ADD CONSTRAINT FK_E5AD23B41844467D FOREIGN KEY (descendant_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program_tag ADD CONSTRAINT FK_88B68E093EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE scratch_program_remix_relation ADD CONSTRAINT FK_3B275E756F212B35 FOREIGN KEY (catrobat_child_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE user_comment ADD CONSTRAINT FK_CC794C66F1496545 FOREIGN KEY (programs) REFERENCES program (id)'); + $this->addSql('ALTER TABLE project ADD CONSTRAINT FK_92ED77849D8F32D0 FOREIGN KEY (approved_by_user) REFERENCES fos_user (id)'); + $this->addSql('ALTER TABLE project ADD CONSTRAINT FK_92ED7784A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); + $this->addSql('ALTER TABLE project_downloads ADD CONSTRAINT FK_1D41556AA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE project_downloads ADD CONSTRAINT FK_1D41556A1748903F FOREIGN KEY (recommended_by_project_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project_downloads ADD CONSTRAINT FK_1D41556A3EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project_downloads ADD CONSTRAINT FK_1D41556A7140A621 FOREIGN KEY (rec_from_project_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project_extension ADD CONSTRAINT FK_C985CCA83EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE ProjectInappropriateReport ADD CONSTRAINT FK_ED222248A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE ProjectInappropriateReport ADD CONSTRAINT FK_ED2222483EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project_like ADD CONSTRAINT FK_A18515B4A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); + $this->addSql('ALTER TABLE project_like ADD CONSTRAINT FK_A18515B43EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project_remix_backward_relation ADD CONSTRAINT FK_C294015B727ACA70 FOREIGN KEY (parent_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project_remix_backward_relation ADD CONSTRAINT FK_C294015BDD62C21B FOREIGN KEY (child_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project_remix_relation ADD CONSTRAINT FK_E5AD23B4C671CEA1 FOREIGN KEY (ancestor_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project_remix_relation ADD CONSTRAINT FK_E5AD23B41844467D FOREIGN KEY (descendant_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project_tag ADD CONSTRAINT FK_88B68E093EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE scratch_project_remix_relation ADD CONSTRAINT FK_3B275E756F212B35 FOREIGN KEY (catrobat_child_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE user_comment ADD CONSTRAINT FK_CC794C66F1496545 FOREIGN KEY (projects) REFERENCES project (id)'); $this->addSql('ALTER TABLE user_like_similarity_relation ADD CONSTRAINT FK_132DCA08B4E2BF69 FOREIGN KEY (first_user_id) REFERENCES fos_user (id)'); $this->addSql('ALTER TABLE user_like_similarity_relation ADD CONSTRAINT FK_132DCA08B02C53F8 FOREIGN KEY (second_user_id) REFERENCES fos_user (id)'); $this->addSql('ALTER TABLE user_remix_similarity_relation ADD CONSTRAINT FK_143F09C7B4E2BF69 FOREIGN KEY (first_user_id) REFERENCES fos_user (id)'); diff --git a/migrations/2019/Version20190731104854.php b/migrations/2019/Version20190731104854.php index a690e38c74..f0148a66e0 100644 --- a/migrations/2019/Version20190731104854.php +++ b/migrations/2019/Version20190731104854.php @@ -22,26 +22,26 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program CHANGE approved_by_user approved_by_user CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE category_id category_id INT DEFAULT NULL, CHANGE gamejam_id gamejam_id INT DEFAULT NULL, CHANGE directory_hash directory_hash VARCHAR(255) DEFAULT NULL, CHANGE catrobat_version_name catrobat_version_name VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE upload_ip upload_ip VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL, CHANGE upload_language upload_language VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE apk_request_time apk_request_time DATETIME DEFAULT NULL, CHANGE gamejam_submission_date gamejam_submission_date DATETIME DEFAULT NULL, CHANGE remix_migrated_at remix_migrated_at DATETIME DEFAULT NULL'); + $this->addSql('ALTER TABLE project CHANGE approved_by_user approved_by_user CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE category_id category_id INT DEFAULT NULL, CHANGE gamejam_id gamejam_id INT DEFAULT NULL, CHANGE directory_hash directory_hash VARCHAR(255) DEFAULT NULL, CHANGE catrobat_version_name catrobat_version_name VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE upload_ip upload_ip VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL, CHANGE upload_language upload_language VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE apk_request_time apk_request_time DATETIME DEFAULT NULL, CHANGE gamejam_submission_date gamejam_submission_date DATETIME DEFAULT NULL, CHANGE remix_migrated_at remix_migrated_at DATETIME DEFAULT NULL'); $this->addSql('ALTER TABLE fos_user CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data JSON DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data JSON DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data JSON DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL, CHANGE upload_token upload_token VARCHAR(300) DEFAULT NULL, CHANGE country country VARCHAR(5) DEFAULT \'\' NOT NULL, CHANGE additional_email additional_email VARCHAR(255) DEFAULT NULL, CHANGE gplus_access_token gplus_access_token VARCHAR(300) DEFAULT NULL, CHANGE gplus_id_token gplus_id_token VARCHAR(5000) DEFAULT NULL, CHANGE gplus_refresh_token gplus_refresh_token VARCHAR(300) DEFAULT NULL, CHANGE dn dn VARCHAR(255) DEFAULT NULL'); $this->addSql('ALTER TABLE tags CHANGE en en VARCHAR(255) DEFAULT NULL, CHANGE de de VARCHAR(255) DEFAULT NULL, CHANGE it it VARCHAR(255) DEFAULT NULL, CHANGE fr fr VARCHAR(255) DEFAULT NULL'); $this->addSql('ALTER TABLE extension CHANGE name name VARCHAR(255) DEFAULT NULL, CHANGE prefix prefix VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE program_remix_relation CHANGE seen_at seen_at DATETIME DEFAULT NULL'); - $this->addSql('ALTER TABLE program_remix_backward_relation CHANGE seen_at seen_at DATETIME DEFAULT NULL'); + $this->addSql('ALTER TABLE project_remix_relation CHANGE seen_at seen_at DATETIME DEFAULT NULL'); + $this->addSql('ALTER TABLE project_remix_backward_relation CHANGE seen_at seen_at DATETIME DEFAULT NULL'); $this->addSql('ALTER TABLE GameJam CHANGE form_url form_url VARCHAR(300) DEFAULT NULL, CHANGE hashtag hashtag VARCHAR(100) DEFAULT NULL, CHANGE flavor flavor VARCHAR(100) DEFAULT NULL'); - $this->addSql('ALTER TABLE program_downloads CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE rec_from_program_id rec_from_program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE recommended_by_program_id recommended_by_program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\', CHANGE recommended_by_page_id recommended_by_page_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE scratch_program CHANGE name name VARCHAR(300) DEFAULT NULL'); - $this->addSql('ALTER TABLE click_statistics CHANGE tag_id tag_id INT DEFAULT NULL, CHANGE extension_id extension_id INT DEFAULT NULL, CHANGE program_id program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE rec_from_program_id rec_from_program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\', CHANGE scratch_program_id scratch_program_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE user_comment CHANGE programs programs CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE userId userId CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE CatroNotification CHANGE comment_id comment_id INT DEFAULT NULL, CHANGE like_from like_from CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE program_id program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE follower_id follower_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE featured CHANGE program_id program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE url url VARCHAR(255) DEFAULT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL'); + $this->addSql('ALTER TABLE project_downloads CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE rec_from_project_id rec_from_project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE recommended_by_project_id recommended_by_project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\', CHANGE recommended_by_page_id recommended_by_page_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT NULL'); + $this->addSql('ALTER TABLE scratch_project CHANGE name name VARCHAR(300) DEFAULT NULL'); + $this->addSql('ALTER TABLE click_statistics CHANGE tag_id tag_id INT DEFAULT NULL, CHANGE extension_id extension_id INT DEFAULT NULL, CHANGE project_id project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE rec_from_project_id rec_from_project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\', CHANGE scratch_project_id scratch_project_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT NULL'); + $this->addSql('ALTER TABLE user_comment CHANGE projects projects CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE userId userId CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE CatroNotification CHANGE comment_id comment_id INT DEFAULT NULL, CHANGE like_from like_from CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE project_id project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE follower_id follower_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE featured CHANGE project_id project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE url url VARCHAR(255) DEFAULT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL'); $this->addSql('ALTER TABLE homepage_click_statistics DROP FOREIGN KEY FK_99AECB2FA76ED395'); - $this->addSql('ALTER TABLE homepage_click_statistics CHANGE program_id program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE locale locale VARCHAR(255) DEFAULT NULL, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\''); + $this->addSql('ALTER TABLE homepage_click_statistics CHANGE project_id project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE locale locale VARCHAR(255) DEFAULT NULL, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\''); $this->addSql('ALTER TABLE homepage_click_statistics ADD CONSTRAINT FK_99AECB2FA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE media_package_file CHANGE category_id category_id INT DEFAULT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'pocketcode\', CHANGE author author VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE ProgramInappropriateReport DROP FOREIGN KEY FK_ED2222483EB8070A'); - $this->addSql('ALTER TABLE ProgramInappropriateReport CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE program_id program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE ProgramInappropriateReport ADD CONSTRAINT FK_ED2222483EB8070A FOREIGN KEY (program_id) REFERENCES program (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE ProjectInappropriateReport DROP FOREIGN KEY FK_ED2222483EB8070A'); + $this->addSql('ALTER TABLE ProjectInappropriateReport CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE project_id project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE ProjectInappropriateReport ADD CONSTRAINT FK_ED2222483EB8070A FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE acl_object_identities CHANGE parent_object_identity_id parent_object_identity_id INT UNSIGNED DEFAULT NULL'); $this->addSql('ALTER TABLE acl_entries CHANGE object_identity_id object_identity_id INT UNSIGNED DEFAULT NULL, CHANGE field_name field_name VARCHAR(50) DEFAULT NULL'); } @@ -51,27 +51,27 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE CatroNotification CHANGE comment_id comment_id INT DEFAULT NULL, CHANGE like_from like_from CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE program_id program_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE follower_id follower_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE CatroNotification CHANGE comment_id comment_id INT DEFAULT NULL, CHANGE like_from like_from CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE project_id project_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE follower_id follower_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\''); $this->addSql('ALTER TABLE GameJam CHANGE form_url form_url VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE hashtag hashtag VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE flavor flavor VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE ProgramInappropriateReport DROP FOREIGN KEY FK_ED2222483EB8070A'); - $this->addSql('ALTER TABLE ProgramInappropriateReport CHANGE user_id user_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE program_id program_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE ProgramInappropriateReport ADD CONSTRAINT FK_ED2222483EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); + $this->addSql('ALTER TABLE ProjectInappropriateReport DROP FOREIGN KEY FK_ED2222483EB8070A'); + $this->addSql('ALTER TABLE ProjectInappropriateReport CHANGE user_id user_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE project_id project_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE ProjectInappropriateReport ADD CONSTRAINT FK_ED2222483EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); $this->addSql('ALTER TABLE acl_entries CHANGE object_identity_id object_identity_id INT UNSIGNED DEFAULT NULL, CHANGE field_name field_name VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8_unicode_ci'); $this->addSql('ALTER TABLE acl_object_identities CHANGE parent_object_identity_id parent_object_identity_id INT UNSIGNED DEFAULT NULL'); - $this->addSql('ALTER TABLE click_statistics CHANGE tag_id tag_id INT DEFAULT NULL, CHANGE extension_id extension_id INT DEFAULT NULL, CHANGE program_id program_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE rec_from_program_id rec_from_program_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE scratch_program_id scratch_program_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE click_statistics CHANGE tag_id tag_id INT DEFAULT NULL, CHANGE extension_id extension_id INT DEFAULT NULL, CHANGE project_id project_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE rec_from_project_id rec_from_project_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE scratch_project_id scratch_project_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE extension CHANGE name name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE prefix prefix VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE featured CHANGE program_id program_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE url url VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE flavor flavor VARCHAR(255) DEFAULT \'\'pocketcode\'\' NOT NULL COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE featured CHANGE project_id project_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE url url VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE flavor flavor VARCHAR(255) DEFAULT \'\'pocketcode\'\' NOT NULL COLLATE utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE fos_user CHANGE salt salt VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE last_login last_login DATETIME DEFAULT \'NULL\', CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE password_requested_at password_requested_at DATETIME DEFAULT \'NULL\', CHANGE date_of_birth date_of_birth DATETIME DEFAULT \'NULL\', CHANGE firstname firstname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lastname lastname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE website website VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE biography biography VARCHAR(1000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gender gender VARCHAR(1) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE locale locale VARCHAR(8) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE timezone timezone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE phone phone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_data facebook_data JSON DEFAULT \'NULL\' COLLATE utf8mb4_bin COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_data twitter_data JSON DEFAULT \'NULL\' COLLATE utf8mb4_bin COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_data gplus_data JSON DEFAULT \'NULL\' COLLATE utf8mb4_bin COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE upload_token upload_token VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE country country VARCHAR(5) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE additional_email additional_email VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE dn dn VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_access_token gplus_access_token VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_id_token gplus_id_token VARCHAR(5000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_refresh_token gplus_refresh_token VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE homepage_click_statistics DROP FOREIGN KEY FK_99AECB2FA76ED395'); - $this->addSql('ALTER TABLE homepage_click_statistics CHANGE program_id program_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE homepage_click_statistics CHANGE project_id project_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE homepage_click_statistics ADD CONSTRAINT FK_99AECB2FA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); $this->addSql('ALTER TABLE media_package_file CHANGE category_id category_id INT DEFAULT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'\'pocketcode\'\' COLLATE utf8mb4_unicode_ci, CHANGE author author VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program CHANGE approved_by_user approved_by_user CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE category_id category_id INT DEFAULT NULL, CHANGE gamejam_id gamejam_id INT DEFAULT NULL, CHANGE directory_hash directory_hash VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE catrobat_version_name catrobat_version_name VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE upload_ip upload_ip VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE flavor flavor VARCHAR(255) DEFAULT \'\'pocketcode\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE upload_language upload_language VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE remix_migrated_at remix_migrated_at DATETIME DEFAULT \'NULL\', CHANGE apk_request_time apk_request_time DATETIME DEFAULT \'NULL\', CHANGE gamejam_submission_date gamejam_submission_date DATETIME DEFAULT \'NULL\''); - $this->addSql('ALTER TABLE program_downloads CHANGE recommended_by_program_id recommended_by_program_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE rec_from_program_id rec_from_program_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE recommended_by_page_id recommended_by_page_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program_remix_backward_relation CHANGE seen_at seen_at DATETIME DEFAULT \'NULL\''); - $this->addSql('ALTER TABLE program_remix_relation CHANGE seen_at seen_at DATETIME DEFAULT \'NULL\''); - $this->addSql('ALTER TABLE scratch_program CHANGE name name VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project CHANGE approved_by_user approved_by_user CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE category_id category_id INT DEFAULT NULL, CHANGE gamejam_id gamejam_id INT DEFAULT NULL, CHANGE directory_hash directory_hash VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE catrobat_version_name catrobat_version_name VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE upload_ip upload_ip VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE flavor flavor VARCHAR(255) DEFAULT \'\'pocketcode\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE upload_language upload_language VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE remix_migrated_at remix_migrated_at DATETIME DEFAULT \'NULL\', CHANGE apk_request_time apk_request_time DATETIME DEFAULT \'NULL\', CHANGE gamejam_submission_date gamejam_submission_date DATETIME DEFAULT \'NULL\''); + $this->addSql('ALTER TABLE project_downloads CHANGE recommended_by_project_id recommended_by_project_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE rec_from_project_id rec_from_project_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE recommended_by_page_id recommended_by_page_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project_remix_backward_relation CHANGE seen_at seen_at DATETIME DEFAULT \'NULL\''); + $this->addSql('ALTER TABLE project_remix_relation CHANGE seen_at seen_at DATETIME DEFAULT \'NULL\''); + $this->addSql('ALTER TABLE scratch_project CHANGE name name VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE tags CHANGE en en VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE de de VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE it it VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE fr fr VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE user_comment CHANGE programs programs CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE userId userId INT NOT NULL'); + $this->addSql('ALTER TABLE user_comment CHANGE projects projects CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE userId userId INT NOT NULL'); } } diff --git a/migrations/2019/Version20190927143621.php b/migrations/2019/Version20190927143621.php index 1fa8dd825e..22fc945618 100644 --- a/migrations/2019/Version20190927143621.php +++ b/migrations/2019/Version20190927143621.php @@ -22,22 +22,22 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program_remix_relation CHANGE seen_at seen_at DATETIME DEFAULT NULL'); - $this->addSql('ALTER TABLE program CHANGE approved_by_user approved_by_user CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE category_id category_id INT DEFAULT NULL, CHANGE gamejam_id gamejam_id INT DEFAULT NULL, CHANGE directory_hash directory_hash VARCHAR(255) DEFAULT NULL, CHANGE catrobat_version_name catrobat_version_name VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE upload_ip upload_ip VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL, CHANGE upload_language upload_language VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE apk_request_time apk_request_time DATETIME DEFAULT NULL, CHANGE gamejam_submission_date gamejam_submission_date DATETIME DEFAULT NULL, CHANGE remix_migrated_at remix_migrated_at DATETIME DEFAULT NULL'); + $this->addSql('ALTER TABLE project_remix_relation CHANGE seen_at seen_at DATETIME DEFAULT NULL'); + $this->addSql('ALTER TABLE project CHANGE approved_by_user approved_by_user CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE category_id category_id INT DEFAULT NULL, CHANGE gamejam_id gamejam_id INT DEFAULT NULL, CHANGE directory_hash directory_hash VARCHAR(255) DEFAULT NULL, CHANGE catrobat_version_name catrobat_version_name VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE upload_ip upload_ip VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL, CHANGE upload_language upload_language VARCHAR(255) DEFAULT \'\' NOT NULL, CHANGE apk_request_time apk_request_time DATETIME DEFAULT NULL, CHANGE gamejam_submission_date gamejam_submission_date DATETIME DEFAULT NULL, CHANGE remix_migrated_at remix_migrated_at DATETIME DEFAULT NULL'); $this->addSql('ALTER TABLE fos_user CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data JSON DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data JSON DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data JSON DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL, CHANGE upload_token upload_token VARCHAR(300) DEFAULT NULL, CHANGE country country VARCHAR(5) DEFAULT \'\' NOT NULL, CHANGE additional_email additional_email VARCHAR(255) DEFAULT NULL, CHANGE gplus_access_token gplus_access_token VARCHAR(300) DEFAULT NULL, CHANGE gplus_id_token gplus_id_token VARCHAR(5000) DEFAULT NULL, CHANGE gplus_refresh_token gplus_refresh_token VARCHAR(300) DEFAULT NULL, CHANGE dn dn VARCHAR(255) DEFAULT NULL'); $this->addSql('ALTER TABLE tags CHANGE en en VARCHAR(255) DEFAULT NULL, CHANGE de de VARCHAR(255) DEFAULT NULL, CHANGE it it VARCHAR(255) DEFAULT NULL, CHANGE fr fr VARCHAR(255) DEFAULT NULL'); $this->addSql('ALTER TABLE extension CHANGE name name VARCHAR(255) DEFAULT NULL, CHANGE prefix prefix VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE program_remix_backward_relation CHANGE seen_at seen_at DATETIME DEFAULT NULL'); + $this->addSql('ALTER TABLE project_remix_backward_relation CHANGE seen_at seen_at DATETIME DEFAULT NULL'); $this->addSql('ALTER TABLE GameJam CHANGE form_url form_url VARCHAR(300) DEFAULT NULL, CHANGE hashtag hashtag VARCHAR(100) DEFAULT NULL, CHANGE flavor flavor VARCHAR(100) DEFAULT NULL'); - $this->addSql('ALTER TABLE program_downloads CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE rec_from_program_id rec_from_program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE recommended_by_program_id recommended_by_program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\', CHANGE recommended_by_page_id recommended_by_page_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE scratch_program CHANGE name name VARCHAR(300) DEFAULT NULL'); - $this->addSql('ALTER TABLE click_statistics CHANGE tag_id tag_id INT DEFAULT NULL, CHANGE extension_id extension_id INT DEFAULT NULL, CHANGE program_id program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE rec_from_program_id rec_from_program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\', CHANGE scratch_program_id scratch_program_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE CatroNotification CHANGE comment_id comment_id INT DEFAULT NULL, CHANGE like_from like_from CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE program_id program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE follower_id follower_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE user_comment CHANGE programs programs CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE ProgramInappropriateReport CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE program_id program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE featured CHANGE program_id program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE url url VARCHAR(255) DEFAULT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL'); + $this->addSql('ALTER TABLE project_downloads CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE rec_from_project_id rec_from_project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE recommended_by_project_id recommended_by_project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\', CHANGE recommended_by_page_id recommended_by_page_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT NULL'); + $this->addSql('ALTER TABLE scratch_project CHANGE name name VARCHAR(300) DEFAULT NULL'); + $this->addSql('ALTER TABLE click_statistics CHANGE tag_id tag_id INT DEFAULT NULL, CHANGE extension_id extension_id INT DEFAULT NULL, CHANGE project_id project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE rec_from_project_id rec_from_project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\', CHANGE scratch_project_id scratch_project_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT NULL'); + $this->addSql('ALTER TABLE CatroNotification CHANGE comment_id comment_id INT DEFAULT NULL, CHANGE like_from like_from CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE project_id project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE follower_id follower_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE user_comment CHANGE projects projects CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE ProjectInappropriateReport CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE project_id project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE featured CHANGE project_id project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE url url VARCHAR(255) DEFAULT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL'); $this->addSql('ALTER TABLE media_package_file CHANGE category_id category_id INT DEFAULT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'pocketcode\', CHANGE author author VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE homepage_click_statistics CHANGE program_id program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE locale locale VARCHAR(255) DEFAULT NULL, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\''); + $this->addSql('ALTER TABLE homepage_click_statistics CHANGE project_id project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', CHANGE locale locale VARCHAR(255) DEFAULT NULL, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\', CHANGE referrer referrer VARCHAR(255) DEFAULT \'\''); $this->addSql('ALTER TABLE acl_object_identities CHANGE parent_object_identity_id parent_object_identity_id INT UNSIGNED DEFAULT NULL'); $this->addSql('ALTER TABLE acl_entries CHANGE object_identity_id object_identity_id INT UNSIGNED DEFAULT NULL, CHANGE field_name field_name VARCHAR(50) DEFAULT NULL'); } @@ -47,23 +47,23 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE CatroNotification CHANGE comment_id comment_id INT DEFAULT NULL, CHANGE like_from like_from CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE program_id program_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE follower_id follower_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE CatroNotification CHANGE comment_id comment_id INT DEFAULT NULL, CHANGE like_from like_from CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE project_id project_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE follower_id follower_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\''); $this->addSql('ALTER TABLE GameJam CHANGE form_url form_url VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE hashtag hashtag VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE flavor flavor VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE ProgramInappropriateReport CHANGE user_id user_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE program_id program_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE ProjectInappropriateReport CHANGE user_id user_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE project_id project_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\''); $this->addSql('ALTER TABLE acl_entries CHANGE object_identity_id object_identity_id INT UNSIGNED DEFAULT NULL, CHANGE field_name field_name VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8_unicode_ci'); $this->addSql('ALTER TABLE acl_object_identities CHANGE parent_object_identity_id parent_object_identity_id INT UNSIGNED DEFAULT NULL'); - $this->addSql('ALTER TABLE click_statistics CHANGE tag_id tag_id INT DEFAULT NULL, CHANGE extension_id extension_id INT DEFAULT NULL, CHANGE program_id program_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE rec_from_program_id rec_from_program_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE scratch_program_id scratch_program_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE click_statistics CHANGE tag_id tag_id INT DEFAULT NULL, CHANGE extension_id extension_id INT DEFAULT NULL, CHANGE project_id project_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE rec_from_project_id rec_from_project_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE scratch_project_id scratch_project_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE extension CHANGE name name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE prefix prefix VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE featured CHANGE program_id program_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE url url VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE flavor flavor VARCHAR(255) DEFAULT \'\'pocketcode\'\' NOT NULL COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE featured CHANGE project_id project_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE url url VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE flavor flavor VARCHAR(255) DEFAULT \'\'pocketcode\'\' NOT NULL COLLATE utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE fos_user CHANGE salt salt VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE last_login last_login DATETIME DEFAULT \'NULL\', CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE password_requested_at password_requested_at DATETIME DEFAULT \'NULL\', CHANGE date_of_birth date_of_birth DATETIME DEFAULT \'NULL\', CHANGE firstname firstname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lastname lastname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE website website VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE biography biography VARCHAR(1000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gender gender VARCHAR(1) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE locale locale VARCHAR(8) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE timezone timezone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE phone phone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_data facebook_data JSON DEFAULT \'NULL\' COLLATE utf8mb4_bin COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_data twitter_data JSON DEFAULT \'NULL\' COLLATE utf8mb4_bin COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_data gplus_data JSON DEFAULT \'NULL\' COLLATE utf8mb4_bin COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE upload_token upload_token VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE country country VARCHAR(5) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE additional_email additional_email VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE dn dn VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_access_token gplus_access_token VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_id_token gplus_id_token VARCHAR(5000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_refresh_token gplus_refresh_token VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE homepage_click_statistics CHANGE program_id program_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE homepage_click_statistics CHANGE project_id project_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE media_package_file CHANGE category_id category_id INT DEFAULT NULL, CHANGE flavor flavor VARCHAR(255) DEFAULT \'\'pocketcode\'\' COLLATE utf8mb4_unicode_ci, CHANGE author author VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program CHANGE approved_by_user approved_by_user CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE category_id category_id INT DEFAULT NULL, CHANGE gamejam_id gamejam_id INT DEFAULT NULL, CHANGE directory_hash directory_hash VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE catrobat_version_name catrobat_version_name VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE upload_ip upload_ip VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE flavor flavor VARCHAR(255) DEFAULT \'\'pocketcode\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE upload_language upload_language VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE remix_migrated_at remix_migrated_at DATETIME DEFAULT \'NULL\', CHANGE apk_request_time apk_request_time DATETIME DEFAULT \'NULL\', CHANGE gamejam_submission_date gamejam_submission_date DATETIME DEFAULT \'NULL\''); - $this->addSql('ALTER TABLE program_downloads CHANGE recommended_by_program_id recommended_by_program_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE rec_from_program_id rec_from_program_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE recommended_by_page_id recommended_by_page_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE program_remix_backward_relation CHANGE seen_at seen_at DATETIME DEFAULT \'NULL\''); - $this->addSql('ALTER TABLE program_remix_relation CHANGE seen_at seen_at DATETIME DEFAULT \'NULL\''); - $this->addSql('ALTER TABLE scratch_program CHANGE name name VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project CHANGE approved_by_user approved_by_user CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE category_id category_id INT DEFAULT NULL, CHANGE gamejam_id gamejam_id INT DEFAULT NULL, CHANGE directory_hash directory_hash VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE catrobat_version_name catrobat_version_name VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE upload_ip upload_ip VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE flavor flavor VARCHAR(255) DEFAULT \'\'pocketcode\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE upload_language upload_language VARCHAR(255) DEFAULT \'\'\'\' NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE remix_migrated_at remix_migrated_at DATETIME DEFAULT \'NULL\', CHANGE apk_request_time apk_request_time DATETIME DEFAULT \'NULL\', CHANGE gamejam_submission_date gamejam_submission_date DATETIME DEFAULT \'NULL\''); + $this->addSql('ALTER TABLE project_downloads CHANGE recommended_by_project_id recommended_by_project_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE rec_from_project_id rec_from_project_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE user_id user_id CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE recommended_by_page_id recommended_by_page_id INT DEFAULT NULL, CHANGE locale locale VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE user_agent user_agent VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci, CHANGE referrer referrer VARCHAR(255) DEFAULT \'\'\'\' COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project_remix_backward_relation CHANGE seen_at seen_at DATETIME DEFAULT \'NULL\''); + $this->addSql('ALTER TABLE project_remix_relation CHANGE seen_at seen_at DATETIME DEFAULT \'NULL\''); + $this->addSql('ALTER TABLE scratch_project CHANGE name name VARCHAR(300) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); $this->addSql('ALTER TABLE tags CHANGE en en VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE de de VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE it it VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE fr fr VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci'); - $this->addSql('ALTER TABLE user_comment CHANGE programs programs CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE user_comment CHANGE projects projects CHAR(36) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\''); } } diff --git a/migrations/2019/Version20191108092441.php b/migrations/2019/Version20191108092441.php index c785c8021b..6183d49022 100644 --- a/migrations/2019/Version20191108092441.php +++ b/migrations/2019/Version20191108092441.php @@ -22,7 +22,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program ADD credits LONGTEXT NOT NULL'); + $this->addSql('ALTER TABLE project ADD credits LONGTEXT NOT NULL'); $this->addSql('ALTER TABLE user_test_group CHANGE user_id user_id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); } @@ -31,7 +31,7 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program DROP credits'); + $this->addSql('ALTER TABLE project DROP credits'); $this->addSql('ALTER TABLE user_test_group CHANGE user_id user_id INT NOT NULL'); } } diff --git a/migrations/2019/Version20191108112739.php b/migrations/2019/Version20191108112739.php index 81df5fff7b..ba62f0685c 100644 --- a/migrations/2019/Version20191108112739.php +++ b/migrations/2019/Version20191108112739.php @@ -22,7 +22,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program CHANGE credits credits LONGTEXT DEFAULT NULL'); + $this->addSql('ALTER TABLE project CHANGE credits credits LONGTEXT DEFAULT NULL'); $this->addSql('ALTER TABLE CatroNotification ADD seen TINYINT(1) DEFAULT \'0\' NOT NULL'); } @@ -32,6 +32,6 @@ public function down(Schema $schema): void $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE CatroNotification DROP seen'); - $this->addSql('ALTER TABLE program CHANGE credits credits LONGTEXT NOT NULL COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project CHANGE credits credits LONGTEXT NOT NULL COLLATE utf8mb4_unicode_ci'); } } diff --git a/migrations/2019/Version20191113124744.php b/migrations/2019/Version20191113124744.php index 3f8c424880..0e63b87e52 100644 --- a/migrations/2019/Version20191113124744.php +++ b/migrations/2019/Version20191113124744.php @@ -22,7 +22,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program CHANGE description description LONGTEXT DEFAULT NULL'); + $this->addSql('ALTER TABLE project CHANGE description description LONGTEXT DEFAULT NULL'); } public function down(Schema $schema): void @@ -30,6 +30,6 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program CHANGE description description LONGTEXT NOT NULL COLLATE utf8mb4_unicode_ci'); + $this->addSql('ALTER TABLE project CHANGE description description LONGTEXT NOT NULL COLLATE utf8mb4_unicode_ci'); } } diff --git a/migrations/2020/Version20200116092044.php b/migrations/2020/Version20200116092044.php index 3e65b84664..8cf16a62b1 100644 --- a/migrations/2020/Version20200116092044.php +++ b/migrations/2020/Version20200116092044.php @@ -24,11 +24,11 @@ public function up(Schema $schema): void $this->addSql('ALTER TABLE user_comment DROP FOREIGN KEY IF EXISTS FK_CC794C66F1496545'); $this->addSql('DROP INDEX IF EXISTS IDX_CC794C66F1496545 ON user_comment'); - $this->addSql('ALTER TABLE user_comment DROP IF EXISTS programs'); - $this->addSql('ALTER TABLE user_comment DROP COLUMN IF EXISTS programId'); - $this->addSql('ALTER TABLE user_comment ADD COLUMN IF NOT EXISTS programId CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE user_comment ADD CONSTRAINT FK_CC794C66BB3368CF FOREIGN KEY (programId) REFERENCES program (id)'); - $this->addSql('CREATE INDEX IDX_CC794C66BB3368CF ON user_comment (programId)'); + $this->addSql('ALTER TABLE user_comment DROP IF EXISTS projects'); + $this->addSql('ALTER TABLE user_comment DROP COLUMN IF EXISTS projectId'); + $this->addSql('ALTER TABLE user_comment ADD COLUMN IF NOT EXISTS projectId CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE user_comment ADD CONSTRAINT FK_CC794C66BB3368CF FOREIGN KEY (projectId) REFERENCES project (id)'); + $this->addSql('CREATE INDEX IDX_CC794C66BB3368CF ON user_comment (projectId)'); } public function down(Schema $schema): void @@ -38,8 +38,8 @@ public function down(Schema $schema): void $this->addSql('ALTER TABLE user_comment DROP FOREIGN KEY IF EXISTS FK_CC794C66BB3368CF'); $this->addSql('DROP INDEX IF EXISTS IDX_CC794C66BB3368CF ON user_comment'); - $this->addSql('ALTER TABLE user_comment ADD programs CHAR(36) DEFAULT NULL COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE programId programId INT NOT NULL'); - $this->addSql('ALTER TABLE user_comment ADD CONSTRAINT FK_CC794C66F1496545 FOREIGN KEY (programs) REFERENCES program (id)'); - $this->addSql('CREATE INDEX IDX_CC794C66F1496545 ON user_comment (programs)'); + $this->addSql('ALTER TABLE user_comment ADD projects CHAR(36) DEFAULT NULL COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:guid)\', CHANGE projectId projectId INT NOT NULL'); + $this->addSql('ALTER TABLE user_comment ADD CONSTRAINT FK_CC794C66F1496545 FOREIGN KEY (projects) REFERENCES project (id)'); + $this->addSql('CREATE INDEX IDX_CC794C66F1496545 ON user_comment (projects)'); } } diff --git a/migrations/2020/Version20200214075253.php b/migrations/2020/Version20200214075253.php index 82e96790d8..b0570597bb 100644 --- a/migrations/2020/Version20200214075253.php +++ b/migrations/2020/Version20200214075253.php @@ -22,11 +22,11 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE CatroNotification ADD remix_from CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', ADD remix_program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE CatroNotification ADD remix_from CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', ADD remix_project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); $this->addSql('ALTER TABLE CatroNotification ADD CONSTRAINT FK_22087FCA976EECBE FOREIGN KEY (remix_from) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE CatroNotification ADD CONSTRAINT FK_22087FCA63B7B817 FOREIGN KEY (remix_program_id) REFERENCES program (id)'); + $this->addSql('ALTER TABLE CatroNotification ADD CONSTRAINT FK_22087FCA63B7B817 FOREIGN KEY (remix_project_id) REFERENCES project (id)'); $this->addSql('CREATE INDEX IDX_22087FCA976EECBE ON CatroNotification (remix_from)'); - $this->addSql('CREATE INDEX IDX_22087FCA63B7B817 ON CatroNotification (remix_program_id)'); + $this->addSql('CREATE INDEX IDX_22087FCA63B7B817 ON CatroNotification (remix_project_id)'); } public function down(Schema $schema): void @@ -38,6 +38,6 @@ public function down(Schema $schema): void $this->addSql('ALTER TABLE CatroNotification DROP FOREIGN KEY FK_22087FCA63B7B817'); $this->addSql('DROP INDEX IDX_22087FCA976EECBE ON CatroNotification'); $this->addSql('DROP INDEX IDX_22087FCA63B7B817 ON CatroNotification'); - $this->addSql('ALTER TABLE CatroNotification DROP remix_from, DROP remix_program_id'); + $this->addSql('ALTER TABLE CatroNotification DROP remix_from, DROP remix_project_id'); } } diff --git a/migrations/2020/Version20200330144935.php b/migrations/2020/Version20200330144935.php index b4f91d90f9..6c02ea89bb 100644 --- a/migrations/2020/Version20200330144935.php +++ b/migrations/2020/Version20200330144935.php @@ -22,7 +22,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE scratch_program CHANGE id id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE scratch_project CHANGE id id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\''); } public function down(Schema $schema): void @@ -30,6 +30,6 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE scratch_program CHANGE id id INT NOT NULL'); + $this->addSql('ALTER TABLE scratch_project CHANGE id id INT NOT NULL'); } } diff --git a/migrations/2020/Version20200405160721.php b/migrations/2020/Version20200405160721.php index 631eb808da..3a5d6671e6 100644 --- a/migrations/2020/Version20200405160721.php +++ b/migrations/2020/Version20200405160721.php @@ -23,7 +23,7 @@ public function up(Schema $schema): void $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('CREATE FULLTEXT INDEX IDX_9FB73D775E237E06 ON extension (name)'); - $this->addSql('CREATE FULLTEXT INDEX IDX_92ED7784BF3967505E237E066DE440264117D17E ON program (id, name, description, credits)'); + $this->addSql('CREATE FULLTEXT INDEX IDX_92ED7784BF3967505E237E066DE440264117D17E ON project (id, name, description, credits)'); $this->addSql('CREATE FULLTEXT INDEX IDX_6FBC9426F359C1427D90298BA28E7734CC75CECE ON tags (en, de, it, fr)'); $this->addSql('CREATE FULLTEXT INDEX IDX_957A6479F85E0677 ON fos_user (username)'); } @@ -35,7 +35,7 @@ public function down(Schema $schema): void $this->addSql('DROP INDEX IDX_9FB73D775E237E06 ON extension'); $this->addSql('DROP INDEX IDX_957A6479F85E0677 ON fos_user'); - $this->addSql('DROP INDEX IDX_92ED7784BF3967505E237E066DE440264117D17E ON program'); + $this->addSql('DROP INDEX IDX_92ED7784BF3967505E237E066DE440264117D17E ON project'); $this->addSql('DROP INDEX IDX_6FBC9426F359C1427D90298BA28E7734CC75CECE ON tags'); } } diff --git a/migrations/2020/Version20200407102527.php b/migrations/2020/Version20200407102527.php index 1cf6e31dee..a99cc5890a 100644 --- a/migrations/2020/Version20200407102527.php +++ b/migrations/2020/Version20200407102527.php @@ -22,8 +22,8 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('CREATE TABLE example (id INT AUTO_INCREMENT NOT NULL, program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', imagetype VARCHAR(255) NOT NULL, url VARCHAR(255) DEFAULT NULL, active TINYINT(1) NOT NULL, flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL, priority INT NOT NULL, for_ios TINYINT(1) DEFAULT \'0\' NOT NULL, INDEX IDX_6EEC9B9F3EB8070A (program_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('ALTER TABLE example ADD CONSTRAINT FK_6EEC9B9F3EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); + $this->addSql('CREATE TABLE example (id INT AUTO_INCREMENT NOT NULL, project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', imagetype VARCHAR(255) NOT NULL, url VARCHAR(255) DEFAULT NULL, active TINYINT(1) NOT NULL, flavor VARCHAR(255) DEFAULT \'pocketcode\' NOT NULL, priority INT NOT NULL, for_ios TINYINT(1) DEFAULT \'0\' NOT NULL, INDEX IDX_6EEC9B9F3EB8070A (project_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('ALTER TABLE example ADD CONSTRAINT FK_6EEC9B9F3EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); } public function down(Schema $schema): void diff --git a/migrations/2020/Version20200617205116.php b/migrations/2020/Version20200617205116.php index 400f29ed2a..25e9d49bab 100644 --- a/migrations/2020/Version20200617205116.php +++ b/migrations/2020/Version20200617205116.php @@ -22,8 +22,8 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); - $this->addSql('ALTER TABLE program ADD scratch_id INT DEFAULT NULL'); - $this->addSql('CREATE UNIQUE INDEX UNIQ_92ED7784711DBBB4 ON program (scratch_id)'); + $this->addSql('ALTER TABLE project ADD scratch_id INT DEFAULT NULL'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_92ED7784711DBBB4 ON project (scratch_id)'); $this->addSql('ALTER TABLE fos_user ADD scratch_user_id INT DEFAULT NULL'); $this->addSql('CREATE UNIQUE INDEX UNIQ_957A64797C85A057 ON fos_user (scratch_user_id)'); } @@ -35,7 +35,7 @@ public function down(Schema $schema): void $this->addSql('DROP INDEX UNIQ_957A64797C85A057 ON fos_user'); $this->addSql('ALTER TABLE fos_user DROP scratch_user_id'); - $this->addSql('DROP INDEX UNIQ_92ED7784711DBBB4 ON program'); - $this->addSql('ALTER TABLE program DROP scratch_id'); + $this->addSql('DROP INDEX UNIQ_92ED7784711DBBB4 ON project'); + $this->addSql('ALTER TABLE project DROP scratch_id'); } } diff --git a/migrations/2020/Version20200627143428.php b/migrations/2020/Version20200627143428.php index b17dc12121..3cbe966ec9 100644 --- a/migrations/2020/Version20200627143428.php +++ b/migrations/2020/Version20200627143428.php @@ -22,7 +22,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->addSql('DROP INDEX IDX_9FB73D775E237E06 ON extension'); $this->addSql('DROP INDEX IDX_957A6479F85E0677 ON fos_user'); - $this->addSql('DROP INDEX IDX_92ED7784BF3967505E237E066DE440264117D17E ON program'); + $this->addSql('DROP INDEX IDX_92ED7784BF3967505E237E066DE440264117D17E ON project'); $this->addSql('DROP INDEX IDX_6FBC9426F359C1427D90298BA28E7734CC75CECE ON tags'); } @@ -31,7 +31,7 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->addSql('CREATE FULLTEXT INDEX IDX_9FB73D775E237E06 ON extension (name)'); $this->addSql('CREATE FULLTEXT INDEX IDX_957A6479F85E0677 ON fos_user (username)'); - $this->addSql('CREATE FULLTEXT INDEX IDX_92ED7784BF3967505E237E066DE440264117D17E ON program (id, name, description, credits)'); + $this->addSql('CREATE FULLTEXT INDEX IDX_92ED7784BF3967505E237E066DE440264117D17E ON project (id, name, description, credits)'); $this->addSql('CREATE FULLTEXT INDEX IDX_6FBC9426F359C1427D90298BA28E7734CC75CECE ON tags (en, de, it, fr)'); } } diff --git a/migrations/2020/Version20200711161214.php b/migrations/2020/Version20200711161214.php index 1c5a2c602f..93162bed5a 100644 --- a/migrations/2020/Version20200711161214.php +++ b/migrations/2020/Version20200711161214.php @@ -21,13 +21,13 @@ public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE fos_user DROP limited'); - $this->addSql('ALTER TABLE program ADD snapshots_enabled TINYINT(1) DEFAULT \'0\' NOT NULL'); + $this->addSql('ALTER TABLE project ADD snapshots_enabled TINYINT(1) DEFAULT \'0\' NOT NULL'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE fos_user ADD limited TINYINT(1) DEFAULT \'0\' NOT NULL'); - $this->addSql('ALTER TABLE program DROP snapshots_enabled'); + $this->addSql('ALTER TABLE project DROP snapshots_enabled'); } } diff --git a/migrations/2020/Version20200810101226.php b/migrations/2020/Version20200810101226.php index eaad9789de..7bf778e541 100644 --- a/migrations/2020/Version20200810101226.php +++ b/migrations/2020/Version20200810101226.php @@ -20,12 +20,12 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE program DROP directory_hash'); + $this->addSql('ALTER TABLE project DROP directory_hash'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE program ADD directory_hash VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`'); + $this->addSql('ALTER TABLE project ADD directory_hash VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`'); } } diff --git a/migrations/2021/Version20210202102935.php b/migrations/2021/Version20210202102935.php index 44604d1189..83c30d882e 100644 --- a/migrations/2021/Version20210202102935.php +++ b/migrations/2021/Version20210202102935.php @@ -20,16 +20,16 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE ProgramInappropriateReport ADD user_id_rep CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE ProgramInappropriateReport ADD CONSTRAINT FK_ED2222481B4D7895 FOREIGN KEY (user_id_rep) REFERENCES fos_user (id) ON DELETE SET NULL'); - $this->addSql('CREATE INDEX IDX_ED2222481B4D7895 ON ProgramInappropriateReport (user_id_rep)'); + $this->addSql('ALTER TABLE ProjectInappropriateReport ADD user_id_rep CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE ProjectInappropriateReport ADD CONSTRAINT FK_ED2222481B4D7895 FOREIGN KEY (user_id_rep) REFERENCES fos_user (id) ON DELETE SET NULL'); + $this->addSql('CREATE INDEX IDX_ED2222481B4D7895 ON ProjectInappropriateReport (user_id_rep)'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE ProgramInappropriateReport DROP FOREIGN KEY FK_ED2222481B4D7895'); - $this->addSql('DROP INDEX IDX_ED2222481B4D7895 ON ProgramInappropriateReport'); - $this->addSql('ALTER TABLE ProgramInappropriateReport DROP user_id_rep'); + $this->addSql('ALTER TABLE ProjectInappropriateReport DROP FOREIGN KEY FK_ED2222481B4D7895'); + $this->addSql('DROP INDEX IDX_ED2222481B4D7895 ON ProjectInappropriateReport'); + $this->addSql('ALTER TABLE ProjectInappropriateReport DROP user_id_rep'); } } diff --git a/migrations/2021/Version20210418060426.php b/migrations/2021/Version20210418060426.php index 66f362ed6d..1fc3f9283d 100644 --- a/migrations/2021/Version20210418060426.php +++ b/migrations/2021/Version20210418060426.php @@ -20,14 +20,14 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE program ADD rand INT DEFAULT 0 NOT NULL'); - $this->addSql('CREATE INDEX rand_idx ON program (rand)'); + $this->addSql('ALTER TABLE project ADD rand INT DEFAULT 0 NOT NULL'); + $this->addSql('CREATE INDEX rand_idx ON project (rand)'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->addSql('DROP INDEX rand_idx ON program'); - $this->addSql('ALTER TABLE program DROP rand'); + $this->addSql('DROP INDEX rand_idx ON project'); + $this->addSql('ALTER TABLE project DROP rand'); } } diff --git a/migrations/2021/Version20210514150949.php b/migrations/2021/Version20210514150949.php index 3b5b588f47..ca8675ccb6 100644 --- a/migrations/2021/Version20210514150949.php +++ b/migrations/2021/Version20210514150949.php @@ -20,12 +20,12 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE program DROP catrobat_version'); + $this->addSql('ALTER TABLE project DROP catrobat_version'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE program ADD catrobat_version INT DEFAULT 0 NOT NULL'); + $this->addSql('ALTER TABLE project ADD catrobat_version INT DEFAULT 0 NOT NULL'); } } diff --git a/migrations/2021/Version20210605095659.php b/migrations/2021/Version20210605095659.php index c4d4bfaaca..374174d239 100644 --- a/migrations/2021/Version20210605095659.php +++ b/migrations/2021/Version20210605095659.php @@ -20,31 +20,31 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE gamejams_sampleprograms DROP FOREIGN KEY FK_8EADA13654B8758D'); - $this->addSql('ALTER TABLE program DROP FOREIGN KEY FK_92ED778454B8758D'); - $this->addSql('ALTER TABLE program DROP FOREIGN KEY FK_92ED778412469DE2'); + $this->addSql('ALTER TABLE gamejams_sampleprojects DROP FOREIGN KEY FK_8EADA13654B8758D'); + $this->addSql('ALTER TABLE project DROP FOREIGN KEY FK_92ED778454B8758D'); + $this->addSql('ALTER TABLE project DROP FOREIGN KEY FK_92ED778412469DE2'); $this->addSql('DROP TABLE GameJam'); - $this->addSql('DROP TABLE gamejams_sampleprograms'); + $this->addSql('DROP TABLE gamejams_sampleprojects'); $this->addSql('DROP TABLE rudewords'); $this->addSql('DROP TABLE starter_category'); - $this->addSql('DROP INDEX IDX_92ED778454B8758D ON program'); - $this->addSql('DROP INDEX IDX_92ED778412469DE2 ON program'); - $this->addSql('ALTER TABLE program DROP category_id, DROP gamejam_id, DROP gamejam_submission_accepted, DROP gamejam_submission_date'); + $this->addSql('DROP INDEX IDX_92ED778454B8758D ON project'); + $this->addSql('DROP INDEX IDX_92ED778412469DE2 ON project'); + $this->addSql('ALTER TABLE project DROP category_id, DROP gamejam_id, DROP gamejam_submission_accepted, DROP gamejam_submission_date'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('CREATE TABLE GameJam (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(300) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, form_url VARCHAR(300) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, start DATETIME NOT NULL, end DATETIME NOT NULL, hashtag VARCHAR(100) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, flavor VARCHAR(100) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); - $this->addSql('CREATE TABLE gamejams_sampleprograms (gamejam_id INT NOT NULL, program_id CHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', INDEX IDX_8EADA13654B8758D (gamejam_id), INDEX IDX_8EADA1363EB8070A (program_id), PRIMARY KEY(gamejam_id, program_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); + $this->addSql('CREATE TABLE gamejams_sampleprojects (gamejam_id INT NOT NULL, project_id CHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', INDEX IDX_8EADA13654B8758D (gamejam_id), INDEX IDX_8EADA1363EB8070A (project_id), PRIMARY KEY(gamejam_id, project_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); $this->addSql('CREATE TABLE rudewords (id INT AUTO_INCREMENT NOT NULL, word VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, UNIQUE INDEX UNIQ_4C737F87C3F17511 (word), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); $this->addSql('CREATE TABLE starter_category (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, alias VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, order_pos INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); - $this->addSql('ALTER TABLE gamejams_sampleprograms ADD CONSTRAINT FK_8EADA1363EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE gamejams_sampleprograms ADD CONSTRAINT FK_8EADA13654B8758D FOREIGN KEY (gamejam_id) REFERENCES GameJam (id)'); - $this->addSql('ALTER TABLE program ADD category_id INT DEFAULT NULL, ADD gamejam_id INT DEFAULT NULL, ADD gamejam_submission_accepted TINYINT(1) DEFAULT \'0\' NOT NULL, ADD gamejam_submission_date DATETIME DEFAULT NULL'); - $this->addSql('ALTER TABLE program ADD CONSTRAINT FK_92ED778412469DE2 FOREIGN KEY (category_id) REFERENCES starter_category (id)'); - $this->addSql('ALTER TABLE program ADD CONSTRAINT FK_92ED778454B8758D FOREIGN KEY (gamejam_id) REFERENCES GameJam (id)'); - $this->addSql('CREATE INDEX IDX_92ED778454B8758D ON program (gamejam_id)'); - $this->addSql('CREATE INDEX IDX_92ED778412469DE2 ON program (category_id)'); + $this->addSql('ALTER TABLE gamejams_sampleprojects ADD CONSTRAINT FK_8EADA1363EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE gamejams_sampleprojects ADD CONSTRAINT FK_8EADA13654B8758D FOREIGN KEY (gamejam_id) REFERENCES GameJam (id)'); + $this->addSql('ALTER TABLE project ADD category_id INT DEFAULT NULL, ADD gamejam_id INT DEFAULT NULL, ADD gamejam_submission_accepted TINYINT(1) DEFAULT \'0\' NOT NULL, ADD gamejam_submission_date DATETIME DEFAULT NULL'); + $this->addSql('ALTER TABLE project ADD CONSTRAINT FK_92ED778412469DE2 FOREIGN KEY (category_id) REFERENCES starter_category (id)'); + $this->addSql('ALTER TABLE project ADD CONSTRAINT FK_92ED778454B8758D FOREIGN KEY (gamejam_id) REFERENCES GameJam (id)'); + $this->addSql('CREATE INDEX IDX_92ED778454B8758D ON project (gamejam_id)'); + $this->addSql('CREATE INDEX IDX_92ED778412469DE2 ON project (category_id)'); } } diff --git a/migrations/2021/Version20210705203054.php b/migrations/2021/Version20210705203054.php index 9e3ae9b3be..df7df172d1 100644 --- a/migrations/2021/Version20210705203054.php +++ b/migrations/2021/Version20210705203054.php @@ -14,7 +14,7 @@ final class Version20210705203054 extends AbstractMigration { public function getDescription(): string { - return 'program and comment translation'; + return 'project and comment translation'; } public function up(Schema $schema): void @@ -22,7 +22,7 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->addSql('CREATE TABLE project_machine_translation (id INT AUTO_INCREMENT NOT NULL, project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', source_language VARCHAR(5) NOT NULL, target_language VARCHAR(5) NOT NULL, provider VARCHAR(255) NOT NULL, usage_count INT NOT NULL, usage_per_month DOUBLE PRECISION NOT NULL, last_modified_at DATETIME NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_2FCF7039166D1F9C (project_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE user_comment_machine_translation (id INT AUTO_INCREMENT NOT NULL, comment_id INT DEFAULT NULL, source_language VARCHAR(5) NOT NULL, target_language VARCHAR(5) NOT NULL, provider VARCHAR(255) NOT NULL, usage_count INT NOT NULL, usage_per_month DOUBLE PRECISION NOT NULL, last_modified_at DATETIME NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_2CEF8196F8697D13 (comment_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('ALTER TABLE project_machine_translation ADD CONSTRAINT FK_2FCF7039166D1F9C FOREIGN KEY (project_id) REFERENCES program (id)'); + $this->addSql('ALTER TABLE project_machine_translation ADD CONSTRAINT FK_2FCF7039166D1F9C FOREIGN KEY (project_id) REFERENCES project (id)'); $this->addSql('ALTER TABLE user_comment_machine_translation ADD CONSTRAINT FK_2CEF8196F8697D13 FOREIGN KEY (comment_id) REFERENCES user_comment (id)'); } diff --git a/migrations/2021/Version20210718210504.php b/migrations/2021/Version20210718210504.php index a16636429e..f7b1d312f4 100644 --- a/migrations/2021/Version20210718210504.php +++ b/migrations/2021/Version20210718210504.php @@ -21,7 +21,7 @@ public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs $this->addSql('CREATE TABLE project_custom_translation (id INT AUTO_INCREMENT NOT NULL, project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', language VARCHAR(5) NOT NULL, name VARCHAR(300) DEFAULT NULL, description LONGTEXT DEFAULT NULL, credits LONGTEXT DEFAULT NULL, INDEX IDX_34070EC4166D1F9C (project_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('ALTER TABLE project_custom_translation ADD CONSTRAINT FK_34070EC4166D1F9C FOREIGN KEY (project_id) REFERENCES program (id)'); + $this->addSql('ALTER TABLE project_custom_translation ADD CONSTRAINT FK_34070EC4166D1F9C FOREIGN KEY (project_id) REFERENCES project (id)'); } public function down(Schema $schema): void diff --git a/migrations/2021/Version20210730083426.php b/migrations/2021/Version20210730083426.php index 865bd4da9e..8e55699bac 100644 --- a/migrations/2021/Version20210730083426.php +++ b/migrations/2021/Version20210730083426.php @@ -22,14 +22,14 @@ public function up(Schema $schema): void // this up() migration is auto-generated, please modify it to your needs $this->addSql('CREATE TABLE studio (id CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', name VARCHAR(255) NOT NULL, description TEXT NOT NULL, is_public TINYINT(1) DEFAULT \'1\' NOT NULL, is_enabled TINYINT(1) DEFAULT \'1\' NOT NULL, allow_comments TINYINT(1) DEFAULT \'1\' NOT NULL, cover_path VARCHAR(300) DEFAULT NULL, updated_on DATETIME DEFAULT NULL, created_on DATETIME NOT NULL, UNIQUE INDEX UNIQ_4A2B07B65E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE studio_activity (id INT AUTO_INCREMENT NOT NULL, studio CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', user CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', type ENUM(\'comment\', \'project\', \'user\'), created_on DATETIME NOT NULL, INDEX IDX_D076B8584A2B07B6 (studio), INDEX IDX_D076B8588D93D649 (user), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE studio_program (id INT AUTO_INCREMENT NOT NULL, studio CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', activity INT NOT NULL, program CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', user CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', updated_on DATETIME DEFAULT NULL, created_on DATETIME NOT NULL, INDEX IDX_4CB3C24A4A2B07B6 (studio), UNIQUE INDEX UNIQ_4CB3C24AAC74095A (activity), INDEX IDX_4CB3C24A92ED7784 (program), INDEX IDX_4CB3C24A8D93D649 (user), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE studio_project (id INT AUTO_INCREMENT NOT NULL, studio CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', activity INT NOT NULL, project CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', user CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', updated_on DATETIME DEFAULT NULL, created_on DATETIME NOT NULL, INDEX IDX_4CB3C24A4A2B07B6 (studio), UNIQUE INDEX UNIQ_4CB3C24AAC74095A (activity), INDEX IDX_4CB3C24A92ED7784 (project), INDEX IDX_4CB3C24A8D93D649 (user), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE studio_user (id INT AUTO_INCREMENT NOT NULL, studio CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', activity INT NOT NULL, user CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', role ENUM(\'admin\', \'member\'), status ENUM(\'active\', \'banned\', \'pending_request\'), updated_on DATETIME DEFAULT NULL, created_on DATETIME NOT NULL, INDEX IDX_EC686DD14A2B07B6 (studio), UNIQUE INDEX UNIQ_EC686DD1AC74095A (activity), INDEX IDX_EC686DD18D93D649 (user), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('ALTER TABLE studio_activity ADD CONSTRAINT FK_D076B8584A2B07B6 FOREIGN KEY (studio) REFERENCES studio (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE studio_activity ADD CONSTRAINT FK_D076B8588D93D649 FOREIGN KEY (user) REFERENCES fos_user (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE studio_program ADD CONSTRAINT FK_4CB3C24A4A2B07B6 FOREIGN KEY (studio) REFERENCES studio (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE studio_program ADD CONSTRAINT FK_4CB3C24AAC74095A FOREIGN KEY (activity) REFERENCES studio_activity (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE studio_program ADD CONSTRAINT FK_4CB3C24A92ED7784 FOREIGN KEY (program) REFERENCES program (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE studio_program ADD CONSTRAINT FK_4CB3C24A8D93D649 FOREIGN KEY (user) REFERENCES fos_user (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE studio_project ADD CONSTRAINT FK_4CB3C24A4A2B07B6 FOREIGN KEY (studio) REFERENCES studio (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE studio_project ADD CONSTRAINT FK_4CB3C24AAC74095A FOREIGN KEY (activity) REFERENCES studio_activity (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE studio_project ADD CONSTRAINT FK_4CB3C24A92ED7784 FOREIGN KEY (project) REFERENCES project (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE studio_project ADD CONSTRAINT FK_4CB3C24A8D93D649 FOREIGN KEY (user) REFERENCES fos_user (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE studio_user ADD CONSTRAINT FK_EC686DD14A2B07B6 FOREIGN KEY (studio) REFERENCES studio (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE studio_user ADD CONSTRAINT FK_EC686DD1AC74095A FOREIGN KEY (activity) REFERENCES studio_activity (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE studio_user ADD CONSTRAINT FK_EC686DD18D93D649 FOREIGN KEY (user) REFERENCES fos_user (id) ON DELETE CASCADE'); @@ -44,15 +44,15 @@ public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE studio_activity DROP FOREIGN KEY FK_D076B8584A2B07B6'); - $this->addSql('ALTER TABLE studio_program DROP FOREIGN KEY FK_4CB3C24A4A2B07B6'); + $this->addSql('ALTER TABLE studio_project DROP FOREIGN KEY FK_4CB3C24A4A2B07B6'); $this->addSql('ALTER TABLE studio_user DROP FOREIGN KEY FK_EC686DD14A2B07B6'); $this->addSql('ALTER TABLE user_comment DROP FOREIGN KEY FK_CC794C664A2B07B6'); - $this->addSql('ALTER TABLE studio_program DROP FOREIGN KEY FK_4CB3C24AAC74095A'); + $this->addSql('ALTER TABLE studio_project DROP FOREIGN KEY FK_4CB3C24AAC74095A'); $this->addSql('ALTER TABLE studio_user DROP FOREIGN KEY FK_EC686DD1AC74095A'); $this->addSql('ALTER TABLE user_comment DROP FOREIGN KEY FK_CC794C66AC74095A'); $this->addSql('DROP TABLE studio'); $this->addSql('DROP TABLE studio_activity'); - $this->addSql('DROP TABLE studio_program'); + $this->addSql('DROP TABLE studio_project'); $this->addSql('DROP TABLE studio_user'); $this->addSql('DROP INDEX IDX_CC794C664A2B07B6 ON user_comment'); $this->addSql('DROP INDEX UNIQ_CC794C66AC74095A ON user_comment'); diff --git a/migrations/2021/Version20211117171810.php b/migrations/2021/Version20211117171810.php index 72818564cb..c6406e6b25 100644 --- a/migrations/2021/Version20211117171810.php +++ b/migrations/2021/Version20211117171810.php @@ -23,15 +23,15 @@ public function up(Schema $schema): void $this->addSql('DROP TABLE click_statistics'); $this->addSql('DROP TABLE homepage_click_statistics'); $this->addSql('ALTER TABLE fos_user DROP country, DROP additional_email'); - $this->addSql('ALTER TABLE program_downloads DROP FOREIGN KEY FK_1D41556A1748903F'); - $this->addSql('ALTER TABLE program_downloads DROP FOREIGN KEY FK_1D41556A7140A621'); - $this->addSql('ALTER TABLE program_downloads DROP FOREIGN KEY FK_1D41556AA76ED395'); - $this->addSql('DROP INDEX IDX_1D41556A7140A621 ON program_downloads'); - $this->addSql('DROP INDEX IDX_1D41556A1748903F ON program_downloads'); - $this->addSql('DROP INDEX IDX_1D41556AA76ED395 ON program_downloads'); - $this->addSql('ALTER TABLE program_downloads ADD user CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', DROP user_id, DROP rec_from_program_id, DROP recommended_by_program_id, DROP ip, DROP country_code, DROP country_name, DROP user_agent, DROP referrer, DROP recommended_by_page_id, DROP locale, DROP user_specific_recommendation'); - $this->addSql('ALTER TABLE program_downloads ADD CONSTRAINT FK_1D41556A8D93D649 FOREIGN KEY (user) REFERENCES fos_user (id) ON DELETE SET NULL'); - $this->addSql('CREATE INDEX IDX_1D41556A8D93D649 ON program_downloads (user)'); + $this->addSql('ALTER TABLE project_downloads DROP FOREIGN KEY FK_1D41556A1748903F'); + $this->addSql('ALTER TABLE project_downloads DROP FOREIGN KEY FK_1D41556A7140A621'); + $this->addSql('ALTER TABLE project_downloads DROP FOREIGN KEY FK_1D41556AA76ED395'); + $this->addSql('DROP INDEX IDX_1D41556A7140A621 ON project_downloads'); + $this->addSql('DROP INDEX IDX_1D41556A1748903F ON project_downloads'); + $this->addSql('DROP INDEX IDX_1D41556AA76ED395 ON project_downloads'); + $this->addSql('ALTER TABLE project_downloads ADD user CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\', DROP user_id, DROP rec_from_project_id, DROP recommended_by_project_id, DROP ip, DROP country_code, DROP country_name, DROP user_agent, DROP referrer, DROP recommended_by_page_id, DROP locale, DROP user_specific_recommendation'); + $this->addSql('ALTER TABLE project_downloads ADD CONSTRAINT FK_1D41556A8D93D649 FOREIGN KEY (user) REFERENCES fos_user (id) ON DELETE SET NULL'); + $this->addSql('CREATE INDEX IDX_1D41556A8D93D649 ON project_downloads (user)'); $this->addSql('ALTER TABLE studio_activity CHANGE type type ENUM(\'comment\', \'project\', \'user\')'); $this->addSql('ALTER TABLE studio_user CHANGE role role ENUM(\'admin\', \'member\'), CHANGE status status ENUM(\'active\', \'banned\', \'pending_request\')'); } @@ -39,25 +39,25 @@ public function up(Schema $schema): void public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TABLE click_statistics (id INT AUTO_INCREMENT NOT NULL, tag_id INT DEFAULT NULL, extension_id INT DEFAULT NULL, program_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', rec_from_program_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', user_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', type LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, clicked_at DATETIME NOT NULL, ip LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, country_code LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, country_name LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, user_agent VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \'\' COLLATE `utf8mb4_unicode_ci`, referrer VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \'\' COLLATE `utf8mb4_unicode_ci`, scratch_program_id INT DEFAULT NULL, locale VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, user_specific_recommendation TINYINT(1) DEFAULT \'0\', INDEX IDX_D9945A6E3EB8070A (program_id), INDEX IDX_D9945A6E7140A621 (rec_from_program_id), INDEX IDX_D9945A6EBAD26311 (tag_id), INDEX IDX_D9945A6EA76ED395 (user_id), INDEX IDX_D9945A6E812D5EB (extension_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); - $this->addSql('CREATE TABLE homepage_click_statistics (id INT AUTO_INCREMENT NOT NULL, program_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', user_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', type LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, clicked_at DATETIME NOT NULL, ip LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, locale VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, user_agent VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \'\' COLLATE `utf8mb4_unicode_ci`, referrer VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \'\' COLLATE `utf8mb4_unicode_ci`, country_code LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, country_name LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_99AECB2F3EB8070A (program_id), INDEX IDX_99AECB2FA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); - $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E3EB8070A FOREIGN KEY (program_id) REFERENCES program (id) ON DELETE SET NULL'); - $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E7140A621 FOREIGN KEY (rec_from_program_id) REFERENCES program (id) ON DELETE SET NULL'); + $this->addSql('CREATE TABLE click_statistics (id INT AUTO_INCREMENT NOT NULL, tag_id INT DEFAULT NULL, extension_id INT DEFAULT NULL, project_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', rec_from_project_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', user_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', type LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, clicked_at DATETIME NOT NULL, ip LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, country_code LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, country_name LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, user_agent VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \'\' COLLATE `utf8mb4_unicode_ci`, referrer VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \'\' COLLATE `utf8mb4_unicode_ci`, scratch_project_id INT DEFAULT NULL, locale VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, user_specific_recommendation TINYINT(1) DEFAULT \'0\', INDEX IDX_D9945A6E3EB8070A (project_id), INDEX IDX_D9945A6E7140A621 (rec_from_project_id), INDEX IDX_D9945A6EBAD26311 (tag_id), INDEX IDX_D9945A6EA76ED395 (user_id), INDEX IDX_D9945A6E812D5EB (extension_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); + $this->addSql('CREATE TABLE homepage_click_statistics (id INT AUTO_INCREMENT NOT NULL, project_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', user_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', type LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, clicked_at DATETIME NOT NULL, ip LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, locale VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, user_agent VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \'\' COLLATE `utf8mb4_unicode_ci`, referrer VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \'\' COLLATE `utf8mb4_unicode_ci`, country_code LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, country_name LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_99AECB2F3EB8070A (project_id), INDEX IDX_99AECB2FA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); + $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E3EB8070A FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E7140A621 FOREIGN KEY (rec_from_project_id) REFERENCES project (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6E812D5EB FOREIGN KEY (extension_id) REFERENCES extension (id)'); $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6EA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE click_statistics ADD CONSTRAINT FK_D9945A6EBAD26311 FOREIGN KEY (tag_id) REFERENCES tags (id)'); - $this->addSql('ALTER TABLE homepage_click_statistics ADD CONSTRAINT FK_99AECB2F3EB8070A FOREIGN KEY (program_id) REFERENCES program (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE homepage_click_statistics ADD CONSTRAINT FK_99AECB2F3EB8070A FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE homepage_click_statistics ADD CONSTRAINT FK_99AECB2FA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE fos_user ADD country VARCHAR(75) CHARACTER SET utf8mb4 DEFAULT \'\' NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD additional_email VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`'); - $this->addSql('ALTER TABLE program_downloads DROP FOREIGN KEY FK_1D41556A8D93D649'); - $this->addSql('DROP INDEX IDX_1D41556A8D93D649 ON program_downloads'); - $this->addSql('ALTER TABLE program_downloads ADD rec_from_program_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', ADD recommended_by_program_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', ADD ip LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD country_code LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD country_name LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD user_agent VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \'\' COLLATE `utf8mb4_unicode_ci`, ADD referrer VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \'\' COLLATE `utf8mb4_unicode_ci`, ADD recommended_by_page_id INT DEFAULT NULL, ADD locale VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD user_specific_recommendation TINYINT(1) DEFAULT \'0\', CHANGE user user_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE program_downloads ADD CONSTRAINT FK_1D41556A1748903F FOREIGN KEY (recommended_by_program_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program_downloads ADD CONSTRAINT FK_1D41556A7140A621 FOREIGN KEY (rec_from_program_id) REFERENCES program (id)'); - $this->addSql('ALTER TABLE program_downloads ADD CONSTRAINT FK_1D41556AA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE SET NULL'); - $this->addSql('CREATE INDEX IDX_1D41556A7140A621 ON program_downloads (rec_from_program_id)'); - $this->addSql('CREATE INDEX IDX_1D41556A1748903F ON program_downloads (recommended_by_program_id)'); - $this->addSql('CREATE INDEX IDX_1D41556AA76ED395 ON program_downloads (user_id)'); + $this->addSql('ALTER TABLE project_downloads DROP FOREIGN KEY FK_1D41556A8D93D649'); + $this->addSql('DROP INDEX IDX_1D41556A8D93D649 ON project_downloads'); + $this->addSql('ALTER TABLE project_downloads ADD rec_from_project_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', ADD recommended_by_project_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', ADD ip LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD country_code LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD country_name LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD user_agent VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \'\' COLLATE `utf8mb4_unicode_ci`, ADD referrer VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \'\' COLLATE `utf8mb4_unicode_ci`, ADD recommended_by_page_id INT DEFAULT NULL, ADD locale VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD user_specific_recommendation TINYINT(1) DEFAULT \'0\', CHANGE user user_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE project_downloads ADD CONSTRAINT FK_1D41556A1748903F FOREIGN KEY (recommended_by_project_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project_downloads ADD CONSTRAINT FK_1D41556A7140A621 FOREIGN KEY (rec_from_project_id) REFERENCES project (id)'); + $this->addSql('ALTER TABLE project_downloads ADD CONSTRAINT FK_1D41556AA76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE SET NULL'); + $this->addSql('CREATE INDEX IDX_1D41556A7140A621 ON project_downloads (rec_from_project_id)'); + $this->addSql('CREATE INDEX IDX_1D41556A1748903F ON project_downloads (recommended_by_project_id)'); + $this->addSql('CREATE INDEX IDX_1D41556AA76ED395 ON project_downloads (user_id)'); $this->addSql('ALTER TABLE studio_activity CHANGE type type VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`'); $this->addSql('ALTER TABLE studio_user CHANGE role role VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE status status VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`'); } diff --git a/migrations/2021/Version20211119152351.php b/migrations/2021/Version20211119152351.php index d737dcaa83..8bde06e96d 100644 --- a/migrations/2021/Version20211119152351.php +++ b/migrations/2021/Version20211119152351.php @@ -21,9 +21,9 @@ public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE project_custom_translation DROP FOREIGN KEY FK_34070EC4166D1F9C'); - $this->addSql('ALTER TABLE project_custom_translation ADD CONSTRAINT FK_34070EC4166D1F9C FOREIGN KEY (project_id) REFERENCES program (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE project_custom_translation ADD CONSTRAINT FK_34070EC4166D1F9C FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE project_machine_translation DROP FOREIGN KEY FK_2FCF7039166D1F9C'); - $this->addSql('ALTER TABLE project_machine_translation ADD CONSTRAINT FK_2FCF7039166D1F9C FOREIGN KEY (project_id) REFERENCES program (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE project_machine_translation ADD CONSTRAINT FK_2FCF7039166D1F9C FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE user_comment_machine_translation DROP FOREIGN KEY FK_2CEF8196F8697D13'); $this->addSql('ALTER TABLE user_comment_machine_translation ADD CONSTRAINT FK_2CEF8196F8697D13 FOREIGN KEY (comment_id) REFERENCES user_comment (id) ON DELETE CASCADE'); } @@ -32,9 +32,9 @@ public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE project_custom_translation DROP FOREIGN KEY FK_34070EC4166D1F9C'); - $this->addSql('ALTER TABLE project_custom_translation ADD CONSTRAINT FK_34070EC4166D1F9C FOREIGN KEY (project_id) REFERENCES program (id)'); + $this->addSql('ALTER TABLE project_custom_translation ADD CONSTRAINT FK_34070EC4166D1F9C FOREIGN KEY (project_id) REFERENCES project (id)'); $this->addSql('ALTER TABLE project_machine_translation DROP FOREIGN KEY FK_2FCF7039166D1F9C'); - $this->addSql('ALTER TABLE project_machine_translation ADD CONSTRAINT FK_2FCF7039166D1F9C FOREIGN KEY (project_id) REFERENCES program (id)'); + $this->addSql('ALTER TABLE project_machine_translation ADD CONSTRAINT FK_2FCF7039166D1F9C FOREIGN KEY (project_id) REFERENCES project (id)'); $this->addSql('ALTER TABLE user_comment_machine_translation DROP FOREIGN KEY FK_2CEF8196F8697D13'); $this->addSql('ALTER TABLE user_comment_machine_translation ADD CONSTRAINT FK_2CEF8196F8697D13 FOREIGN KEY (comment_id) REFERENCES user_comment (id)'); } diff --git a/migrations/2021/Version20211119154437.php b/migrations/2021/Version20211119154437.php index dd565a2420..99c82a02fc 100644 --- a/migrations/2021/Version20211119154437.php +++ b/migrations/2021/Version20211119154437.php @@ -20,16 +20,16 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE program_downloads DROP FOREIGN KEY FK_1D41556A3EB8070A'); - $this->addSql('ALTER TABLE program_downloads CHANGE program_id program_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE program_downloads ADD CONSTRAINT FK_1D41556A3EB8070A FOREIGN KEY (program_id) REFERENCES program (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE project_downloads DROP FOREIGN KEY FK_1D41556A3EB8070A'); + $this->addSql('ALTER TABLE project_downloads CHANGE project_id project_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE project_downloads ADD CONSTRAINT FK_1D41556A3EB8070A FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE SET NULL'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE program_downloads DROP FOREIGN KEY FK_1D41556A3EB8070A'); - $this->addSql('ALTER TABLE program_downloads CHANGE program_id program_id CHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\''); - $this->addSql('ALTER TABLE program_downloads ADD CONSTRAINT FK_1D41556A3EB8070A FOREIGN KEY (program_id) REFERENCES program (id)'); + $this->addSql('ALTER TABLE project_downloads DROP FOREIGN KEY FK_1D41556A3EB8070A'); + $this->addSql('ALTER TABLE project_downloads CHANGE project_id project_id CHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\''); + $this->addSql('ALTER TABLE project_downloads ADD CONSTRAINT FK_1D41556A3EB8070A FOREIGN KEY (project_id) REFERENCES project (id)'); } } diff --git a/migrations/2022/Version20220111134208.php b/migrations/2022/Version20220111134208.php index f044bc7222..5eb7d142ca 100644 --- a/migrations/2022/Version20220111134208.php +++ b/migrations/2022/Version20220111134208.php @@ -20,12 +20,12 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE program_downloads ADD type VARCHAR(255) DEFAULT \'project\' NOT NULL'); + $this->addSql('ALTER TABLE project_downloads ADD type VARCHAR(255) DEFAULT \'project\' NOT NULL'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE program_downloads DROP type'); + $this->addSql('ALTER TABLE project_downloads DROP type'); } } diff --git a/migrations/2022/Version20220204171924.php b/migrations/2022/Version20220204171924.php index e3136eb909..210dfa6ec8 100644 --- a/migrations/2022/Version20220204171924.php +++ b/migrations/2022/Version20220204171924.php @@ -21,7 +21,7 @@ public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs $this->addSql('DROP TABLE Notification'); - $this->addSql('ALTER TABLE program DROP snapshots_enabled'); + $this->addSql('ALTER TABLE project DROP snapshots_enabled'); } public function down(Schema $schema): void @@ -29,6 +29,6 @@ public function down(Schema $schema): void // this down() migration is auto-generated, please modify it to your needs $this->addSql('CREATE TABLE Notification (id INT AUTO_INCREMENT NOT NULL, user CHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', upload TINYINT(1) NOT NULL, report TINYINT(1) NOT NULL, summary TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_A765AD328D93D649 (user), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); $this->addSql('ALTER TABLE Notification ADD CONSTRAINT FK_A765AD328D93D649 FOREIGN KEY (user) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE program ADD snapshots_enabled TINYINT(1) DEFAULT \'0\' NOT NULL'); + $this->addSql('ALTER TABLE project ADD snapshots_enabled TINYINT(1) DEFAULT \'0\' NOT NULL'); } } diff --git a/migrations/2022/Version20220424080425.php b/migrations/2022/Version20220424080425.php index fc9c757a86..43db5c48bb 100644 --- a/migrations/2022/Version20220424080425.php +++ b/migrations/2022/Version20220424080425.php @@ -23,7 +23,7 @@ public function up(Schema $schema): void $this->addSql('ALTER TABLE fos_user_user_group DROP FOREIGN KEY FK_B3C77447FE54D947'); $this->addSql('DROP TABLE fos_user_group'); $this->addSql('DROP TABLE fos_user_user_group'); - $this->addSql('ALTER TABLE ProgramInappropriateReport CHANGE category category TEXT NOT NULL'); + $this->addSql('ALTER TABLE ProjectInappropriateReport CHANGE category category TEXT NOT NULL'); $this->addSql('ALTER TABLE fos_user DROP date_of_birth, DROP firstname, DROP lastname, DROP website, DROP biography, DROP gender, DROP locale, DROP timezone, DROP phone, DROP facebook_uid, DROP facebook_name, DROP facebook_data, DROP twitter_uid, DROP twitter_name, DROP twitter_data, DROP gplus_uid, DROP gplus_name, DROP gplus_data, DROP token, DROP two_step_code'); $this->addSql('ALTER TABLE studio_activity CHANGE type type ENUM(\'comment\', \'project\', \'user\')'); $this->addSql('ALTER TABLE studio_user CHANGE role role ENUM(\'admin\', \'member\'), CHANGE status status ENUM(\'active\', \'banned\', \'pending_request\')'); @@ -38,7 +38,7 @@ public function down(Schema $schema): void $this->addSql('CREATE TABLE fos_user_user_group (user_id CHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:guid)\', group_id INT NOT NULL, INDEX IDX_B3C77447A76ED395 (user_id), INDEX IDX_B3C77447FE54D947 (group_id), PRIMARY KEY(user_id, group_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); $this->addSql('ALTER TABLE fos_user_user_group ADD CONSTRAINT FK_B3C77447FE54D947 FOREIGN KEY (group_id) REFERENCES fos_user_group (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE fos_user_user_group ADD CONSTRAINT FK_B3C77447A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE ProgramInappropriateReport CHANGE category category LONGTEXT NOT NULL'); + $this->addSql('ALTER TABLE ProjectInappropriateReport CHANGE category category LONGTEXT NOT NULL'); $this->addSql('ALTER TABLE fos_user ADD date_of_birth DATETIME DEFAULT NULL, ADD firstname VARCHAR(64) DEFAULT NULL, ADD lastname VARCHAR(64) DEFAULT NULL, ADD website VARCHAR(64) DEFAULT NULL, ADD biography VARCHAR(1000) DEFAULT NULL, ADD gender VARCHAR(1) DEFAULT NULL, ADD locale VARCHAR(8) DEFAULT NULL, ADD timezone VARCHAR(64) DEFAULT NULL, ADD phone VARCHAR(64) DEFAULT NULL, ADD facebook_uid VARCHAR(255) DEFAULT NULL, ADD facebook_name VARCHAR(255) DEFAULT NULL, ADD facebook_data LONGTEXT DEFAULT NULL COLLATE `utf8mb4_bin` COMMENT \'(DC2Type:json)\', ADD twitter_uid VARCHAR(255) DEFAULT NULL, ADD twitter_name VARCHAR(255) DEFAULT NULL, ADD twitter_data LONGTEXT DEFAULT NULL COLLATE `utf8mb4_bin` COMMENT \'(DC2Type:json)\', ADD gplus_uid VARCHAR(255) DEFAULT NULL, ADD gplus_name VARCHAR(255) DEFAULT NULL, ADD gplus_data LONGTEXT DEFAULT NULL COLLATE `utf8mb4_bin` COMMENT \'(DC2Type:json)\', ADD token VARCHAR(255) DEFAULT NULL, ADD two_step_code VARCHAR(255) DEFAULT NULL'); $this->addSql('ALTER TABLE studio_activity CHANGE type type VARCHAR(255) DEFAULT NULL'); $this->addSql('ALTER TABLE studio_user CHANGE role role VARCHAR(255) DEFAULT NULL, CHANGE status status VARCHAR(255) DEFAULT NULL'); diff --git a/migrations/2023/Version20230217100800.php b/migrations/2023/Version20230217100800.php index 3e386954f6..760caf2400 100644 --- a/migrations/2023/Version20230217100800.php +++ b/migrations/2023/Version20230217100800.php @@ -21,38 +21,38 @@ public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs $this->addSql('CREATE INDEX internal_title_idx ON extension (internal_title)'); - $this->addSql('ALTER TABLE program DROP FOREIGN KEY FK_92ED7784A76ED395'); - $this->addSql('CREATE INDEX uploaded_at_idx ON program (uploaded_at)'); - $this->addSql('CREATE INDEX views_idx ON program (views)'); - $this->addSql('CREATE INDEX downloads_idx ON program (downloads)'); - $this->addSql('CREATE INDEX name_idx ON program (name)'); - $this->addSql('CREATE INDEX language_version_idx ON program (language_version)'); - $this->addSql('CREATE INDEX visible_idx ON program (visible)'); - $this->addSql('CREATE INDEX private_idx ON program (private)'); - $this->addSql('CREATE INDEX debug_build_idx ON program (debug_build)'); - $this->addSql('CREATE INDEX flavor_idx ON program (flavor)'); - $this->addSql('DROP INDEX idx_92ed7784a76ed395 ON program'); - $this->addSql('CREATE INDEX user_idx ON program (user_id)'); - $this->addSql('ALTER TABLE program ADD CONSTRAINT FK_92ED7784A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); + $this->addSql('ALTER TABLE project DROP FOREIGN KEY FK_92ED7784A76ED395'); + $this->addSql('CREATE INDEX uploaded_at_idx ON project (uploaded_at)'); + $this->addSql('CREATE INDEX views_idx ON project (views)'); + $this->addSql('CREATE INDEX downloads_idx ON project (downloads)'); + $this->addSql('CREATE INDEX name_idx ON project (name)'); + $this->addSql('CREATE INDEX language_version_idx ON project (language_version)'); + $this->addSql('CREATE INDEX visible_idx ON project (visible)'); + $this->addSql('CREATE INDEX private_idx ON project (private)'); + $this->addSql('CREATE INDEX debug_build_idx ON project (debug_build)'); + $this->addSql('CREATE INDEX flavor_idx ON project (flavor)'); + $this->addSql('DROP INDEX idx_92ed7784a76ed395 ON project'); + $this->addSql('CREATE INDEX user_idx ON project (user_id)'); + $this->addSql('ALTER TABLE project ADD CONSTRAINT FK_92ED7784A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); $this->addSql('CREATE INDEX internal_title_idx ON tags (internal_title)'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->addSql('DROP INDEX uploaded_at_idx ON program'); - $this->addSql('DROP INDEX views_idx ON program'); - $this->addSql('DROP INDEX downloads_idx ON program'); - $this->addSql('DROP INDEX name_idx ON program'); - $this->addSql('DROP INDEX language_version_idx ON program'); - $this->addSql('DROP INDEX visible_idx ON program'); - $this->addSql('DROP INDEX private_idx ON program'); - $this->addSql('DROP INDEX debug_build_idx ON program'); - $this->addSql('DROP INDEX flavor_idx ON program'); - $this->addSql('ALTER TABLE program DROP FOREIGN KEY FK_92ED7784A76ED395'); - $this->addSql('DROP INDEX user_idx ON program'); - $this->addSql('CREATE INDEX IDX_92ED7784A76ED395 ON program (user_id)'); - $this->addSql('ALTER TABLE program ADD CONSTRAINT FK_92ED7784A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); + $this->addSql('DROP INDEX uploaded_at_idx ON project'); + $this->addSql('DROP INDEX views_idx ON project'); + $this->addSql('DROP INDEX downloads_idx ON project'); + $this->addSql('DROP INDEX name_idx ON project'); + $this->addSql('DROP INDEX language_version_idx ON project'); + $this->addSql('DROP INDEX visible_idx ON project'); + $this->addSql('DROP INDEX private_idx ON project'); + $this->addSql('DROP INDEX debug_build_idx ON project'); + $this->addSql('DROP INDEX flavor_idx ON project'); + $this->addSql('ALTER TABLE project DROP FOREIGN KEY FK_92ED7784A76ED395'); + $this->addSql('DROP INDEX user_idx ON project'); + $this->addSql('CREATE INDEX IDX_92ED7784A76ED395 ON project (user_id)'); + $this->addSql('ALTER TABLE project ADD CONSTRAINT FK_92ED7784A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); $this->addSql('DROP INDEX internal_title_idx ON tags'); $this->addSql('DROP INDEX internal_title_idx ON extension'); } diff --git a/migrations/2023/Version20230303155205.php b/migrations/2023/Version20230303155205.php index bcab11a1c6..4127134837 100644 --- a/migrations/2023/Version20230303155205.php +++ b/migrations/2023/Version20230303155205.php @@ -28,11 +28,11 @@ public function up(Schema $schema): void $this->addSql('DROP INDEX idx_cc794c66a76ed395 ON user_comment'); $this->addSql('CREATE INDEX user_id_idx ON user_comment (user_id)'); $this->addSql('DROP INDEX idx_cc794c66bb3368cf ON user_comment'); - $this->addSql('CREATE INDEX program_id_idx ON user_comment (programId)'); + $this->addSql('CREATE INDEX project_id_idx ON user_comment (projectId)'); $this->addSql('DROP INDEX idx_cc794c664a2b07b6 ON user_comment'); $this->addSql('CREATE INDEX studio_idx ON user_comment (studio)'); $this->addSql('ALTER TABLE user_comment ADD CONSTRAINT FK_CC794C664A2B07B6 FOREIGN KEY (studio) REFERENCES studio (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE user_comment ADD CONSTRAINT FK_CC794C66BB3368CF FOREIGN KEY (programId) REFERENCES program (id)'); + $this->addSql('ALTER TABLE user_comment ADD CONSTRAINT FK_CC794C66BB3368CF FOREIGN KEY (projectId) REFERENCES project (id)'); $this->addSql('ALTER TABLE user_comment ADD CONSTRAINT FK_CC794C66A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); } @@ -46,12 +46,12 @@ public function down(Schema $schema): void $this->addSql('ALTER TABLE user_comment DROP FOREIGN KEY FK_CC794C664A2B07B6'); $this->addSql('DROP INDEX studio_idx ON user_comment'); $this->addSql('CREATE INDEX IDX_CC794C664A2B07B6 ON user_comment (studio)'); - $this->addSql('DROP INDEX program_id_idx ON user_comment'); - $this->addSql('CREATE INDEX IDX_CC794C66BB3368CF ON user_comment (programId)'); + $this->addSql('DROP INDEX project_id_idx ON user_comment'); + $this->addSql('CREATE INDEX IDX_CC794C66BB3368CF ON user_comment (projectId)'); $this->addSql('DROP INDEX user_id_idx ON user_comment'); $this->addSql('CREATE INDEX IDX_CC794C66A76ED395 ON user_comment (user_id)'); $this->addSql('ALTER TABLE user_comment ADD CONSTRAINT FK_CC794C66A76ED395 FOREIGN KEY (user_id) REFERENCES fos_user (id)'); - $this->addSql('ALTER TABLE user_comment ADD CONSTRAINT FK_CC794C66BB3368CF FOREIGN KEY (programId) REFERENCES program (id)'); + $this->addSql('ALTER TABLE user_comment ADD CONSTRAINT FK_CC794C66BB3368CF FOREIGN KEY (projectId) REFERENCES project (id)'); $this->addSql('ALTER TABLE user_comment ADD CONSTRAINT FK_CC794C664A2B07B6 FOREIGN KEY (studio) REFERENCES studio (id) ON DELETE CASCADE'); } } diff --git a/migrations/2023/Version20230912132551.php b/migrations/2023/Version20230912132551.php index 79836b99ca..605f838536 100644 --- a/migrations/2023/Version20230912132551.php +++ b/migrations/2023/Version20230912132551.php @@ -20,12 +20,12 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE program ADD popularity DOUBLE PRECISION DEFAULT \'0\' NOT NULL'); + $this->addSql('ALTER TABLE project ADD popularity DOUBLE PRECISION DEFAULT \'0\' NOT NULL'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE program DROP popularity'); + $this->addSql('ALTER TABLE project DROP popularity'); } } diff --git a/src/Admin/ApkGeneration/ApkController.php b/src/Admin/ApkGeneration/ApkController.php index 0b37495227..b2d1cb5a09 100644 --- a/src/Admin/ApkGeneration/ApkController.php +++ b/src/Admin/ApkGeneration/ApkController.php @@ -2,7 +2,7 @@ namespace App\Admin\ApkGeneration; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Project\Apk\JenkinsDispatcher; use App\Project\ProjectManager; use App\Utils\TimeUtils; @@ -11,7 +11,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse; /** - * @phpstan-extends CRUDController + * @phpstan-extends CRUDController */ class ApkController extends CRUDController { @@ -24,13 +24,13 @@ public function __construct( public function resetApkBuildStatusAction(): RedirectResponse { - /** @var Program|null $project */ + /** @var Project|null $project */ $project = $this->admin->getSubject(); if (null === $project) { $this->addFlash('sonata_flash_error', 'Can\'t reset APK status'); } else { - $project->setApkStatus(Program::APK_NONE); + $project->setApkStatus(Project::APK_NONE); $project->setApkRequestTime(null); $this->admin->update($project); $this->addFlash('sonata_flash_success', 'Reset APK status of '.$project->getName().' successful'); @@ -44,7 +44,7 @@ public function resetApkBuildStatusAction(): RedirectResponse */ public function requestApkRebuildAction(): RedirectResponse { - /** @var Program|null $project */ + /** @var Project|null $project */ $project = $this->admin->getSubject(); if (null === $project) { @@ -52,7 +52,7 @@ public function requestApkRebuildAction(): RedirectResponse } else { $this->jenkins_dispatcher->sendBuildRequest($project->getId()); $project->setApkRequestTime(TimeUtils::getDateTime()); - $project->setApkStatus(Program::APK_PENDING); + $project->setApkStatus(Project::APK_PENDING); $this->admin->update($project); $this->addFlash('sonata_flash_success', 'Requested a rebuild of '.$project->getName()); } @@ -63,13 +63,13 @@ public function requestApkRebuildAction(): RedirectResponse public function resetPendingProjectsAction(): RedirectResponse { $this->entity_manager->createQueryBuilder() - ->update(Program::class, 'p') + ->update(Project::class, 'p') ->set('p.apk_status', ':apk_none') ->set('p.apk_request_time', ':time') ->where('p.apk_status = :apk_pending') - ->setParameter('apk_none', Program::APK_NONE) + ->setParameter('apk_none', Project::APK_NONE) ->setParameter('time', null) - ->setParameter('apk_pending', Program::APK_PENDING) + ->setParameter('apk_pending', Project::APK_PENDING) ->getQuery() ->execute() ; @@ -84,13 +84,13 @@ public function resetPendingProjectsAction(): RedirectResponse */ public function rebuildAllApkAction(): RedirectResponse { - $projects = $this->project_manager->findBy(['apk_status' => Program::APK_PENDING]); + $projects = $this->project_manager->findBy(['apk_status' => Project::APK_PENDING]); - /* @var $project Program */ + /* @var $project Project */ foreach ($projects as $project) { $this->jenkins_dispatcher->sendBuildRequest($project->getId()); $project->setApkRequestTime(TimeUtils::getDateTime()); - $project->setApkStatus(Program::APK_PENDING); + $project->setApkStatus(Project::APK_PENDING); $this->admin->update($project); } diff --git a/src/Admin/ApkGeneration/ApkPendingAdmin.php b/src/Admin/ApkGeneration/ApkPendingAdmin.php index ee26be05a0..93e1dfb3eb 100644 --- a/src/Admin/ApkGeneration/ApkPendingAdmin.php +++ b/src/Admin/ApkGeneration/ApkPendingAdmin.php @@ -2,7 +2,7 @@ namespace App\Admin\ApkGeneration; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Storage\ScreenshotRepository; use Sonata\AdminBundle\Admin\AbstractAdmin; use Sonata\AdminBundle\Datagrid\DatagridInterface; @@ -16,7 +16,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType as SymfonyChoiceType; /** - * @phpstan-extends AbstractAdmin + * @phpstan-extends AbstractAdmin */ class ApkPendingAdmin extends AbstractAdmin { @@ -36,7 +36,7 @@ public function __construct( } /** - * @param Program $object + * @param Project $object */ public function getThumbnailImageUrl($object): string { @@ -53,7 +53,7 @@ protected function configureQuery(ProxyQueryInterface $query): ProxyQueryInterfa $qb->andWhere( $qb->expr()->eq($qb->getRootAliases()[0].'.apk_status', ':apk_status') ); - $qb->setParameter('apk_status', Program::APK_PENDING); + $qb->setParameter('apk_status', Project::APK_PENDING); return $query; } @@ -76,7 +76,7 @@ protected function configureDatagridFilters(DatagridMapper $filter): void ->add('apk_status', null, [ 'field_type' => SymfonyChoiceType::class, - 'field_options' => ['choices' => ['None' => Program::APK_NONE, 'Pending' => Program::APK_PENDING, 'Ready' => Program::APK_READY]], + 'field_options' => ['choices' => ['None' => Project::APK_NONE, 'Pending' => Project::APK_PENDING, 'Ready' => Project::APK_READY]], ]) ; } @@ -103,9 +103,9 @@ protected function configureListFields(ListMapper $list): void ]) ->add('apk_status', 'choice', [ 'choices' => [ - Program::APK_NONE => 'None', - Program::APK_PENDING => 'Pending', - Program::APK_READY => 'Ready', + Project::APK_NONE => 'None', + Project::APK_PENDING => 'Pending', + Project::APK_READY => 'Ready', ], ]) ->add(ListMapper::NAME_ACTIONS, null, [ 'actions' => [ diff --git a/src/Admin/ApkGeneration/ApkReadyAdmin.php b/src/Admin/ApkGeneration/ApkReadyAdmin.php index 175b72c73f..8a8ffa2ad8 100644 --- a/src/Admin/ApkGeneration/ApkReadyAdmin.php +++ b/src/Admin/ApkGeneration/ApkReadyAdmin.php @@ -2,7 +2,7 @@ namespace App\Admin\ApkGeneration; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Storage\ScreenshotRepository; use Sonata\AdminBundle\Admin\AbstractAdmin; use Sonata\AdminBundle\Datagrid\DatagridInterface; @@ -13,7 +13,7 @@ use Sonata\DoctrineORMAdminBundle\Datagrid\ProxyQuery; /** - * @phpstan-extends AbstractAdmin + * @phpstan-extends AbstractAdmin */ class ApkReadyAdmin extends AbstractAdmin { @@ -35,7 +35,7 @@ public function __construct( ) { } - public function getThumbnailImageUrl(Program $object): string + public function getThumbnailImageUrl(Project $object): string { return '/'.$this->screenshot_repository->getThumbnailWebPath($object->getId()); } @@ -50,7 +50,7 @@ protected function configureQuery(ProxyQueryInterface $query): ProxyQueryInterfa $qb->andWhere( $qb->expr()->eq($qb->getRootAliases()[0].'.apk_status', ':apk_status') ); - $qb->setParameter('apk_status', Program::APK_READY); + $qb->setParameter('apk_status', Project::APK_READY); return $query; } diff --git a/src/Admin/Comments/ReportedComments/ReportedCommentsAdmin.php b/src/Admin/Comments/ReportedComments/ReportedCommentsAdmin.php index 6ef7f684f6..a6adc75fc2 100644 --- a/src/Admin/Comments/ReportedComments/ReportedCommentsAdmin.php +++ b/src/Admin/Comments/ReportedComments/ReportedCommentsAdmin.php @@ -2,7 +2,7 @@ namespace App\Admin\Comments\ReportedComments; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\Comment\UserComment; use Sonata\AdminBundle\Admin\AbstractAdmin; use Sonata\AdminBundle\Datagrid\DatagridMapper; @@ -56,9 +56,9 @@ protected function configureListFields(ListMapper $list): void { $list ->add('id') - ->add('program', EntityType::class, + ->add('project', EntityType::class, [ - 'class' => Program::class, + 'class' => Project::class, 'editable' => false, ]) ->add('user') diff --git a/src/Admin/Comments/ReportedComments/ReportedCommentsController.php b/src/Admin/Comments/ReportedComments/ReportedCommentsController.php index b3f87c1d5e..129ea13a36 100644 --- a/src/Admin/Comments/ReportedComments/ReportedCommentsController.php +++ b/src/Admin/Comments/ReportedComments/ReportedCommentsController.php @@ -2,7 +2,7 @@ namespace App\Admin\Comments\ReportedComments; -use App\DB\Entity\Project\ProgramInappropriateReport; +use App\DB\Entity\Project\ProjectInappropriateReport; use App\DB\Entity\User\Comment\UserComment; use Doctrine\ORM\EntityManagerInterface; use Sonata\AdminBundle\Controller\CRUDController; @@ -10,7 +10,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * @phpstan-extends CRUDController + * @phpstan-extends CRUDController */ class ReportedCommentsController extends CRUDController { @@ -21,12 +21,12 @@ public function __construct( public function unreportProjectAction(): RedirectResponse { - /** @var ProgramInappropriateReport|null $object */ + /** @var ProjectInappropriateReport|null $object */ $object = $this->admin->getSubject(); if (null === $object) { throw new NotFoundHttpException(); } - $project = $object->getProgram(); + $project = $object->getProject(); $project->setVisible(true); $project->setApproved(true); $object->setState(3); diff --git a/src/Admin/Projects/ApproveProjects/ApproveProjectsAdmin.php b/src/Admin/Projects/ApproveProjects/ApproveProjectsAdmin.php index 347adc50b9..4f08d5f5d7 100644 --- a/src/Admin/Projects/ApproveProjects/ApproveProjectsAdmin.php +++ b/src/Admin/Projects/ApproveProjects/ApproveProjectsAdmin.php @@ -3,7 +3,7 @@ namespace App\Admin\Projects\ApproveProjects; use App\Admin\Projects\ProjectPreUpdateTrait; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; use App\Project\CatrobatFile\ExtractedCatrobatFile; use App\Project\CatrobatFile\ExtractedFileRepository; @@ -25,7 +25,7 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; /** - * @phpstan-extends AbstractAdmin + * @phpstan-extends AbstractAdmin */ class ApproveProjectsAdmin extends AbstractAdmin { @@ -47,7 +47,7 @@ public function __construct( } /** - * @param mixed|Program $object + * @param mixed|Project $object */ public function getThumbnailImageUrl($object): string { @@ -98,7 +98,7 @@ public function getContainingSoundUrls(mixed $object): array } /** - * @param mixed|Program $object + * @param mixed|Project $object */ public function getContainingStrings($object): array { @@ -115,7 +115,7 @@ public function getContainingStrings($object): array } /** - * @param mixed|Program $object + * @param mixed|Project $object */ public function getContainingCodeObjects($object): array { @@ -195,7 +195,7 @@ protected function configureShowFields(ShowMapper $show): void protected function configureFormFields(FormMapper $form): void { $form - ->add('name', TextType::class, ['label' => 'Program name']) + ->add('name', TextType::class, ['label' => 'Project name']) ->add('user', EntityType::class, ['class' => User::class]) ; } diff --git a/src/Admin/Projects/ApproveProjects/ApproveProjectsController.php b/src/Admin/Projects/ApproveProjects/ApproveProjectsController.php index 2b3272a659..61bc258296 100644 --- a/src/Admin/Projects/ApproveProjects/ApproveProjectsController.php +++ b/src/Admin/Projects/ApproveProjects/ApproveProjectsController.php @@ -2,19 +2,19 @@ namespace App\Admin\Projects\ApproveProjects; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use Sonata\AdminBundle\Controller\CRUDController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * @phpstan-extends CRUDController + * @phpstan-extends CRUDController */ class ApproveProjectsController extends CRUDController { public function approveAction(): RedirectResponse { - /** @var Program|null $object */ + /** @var Project|null $object */ $object = $this->admin->getSubject(); $object->setApproved(true); $object->setVisible(true); @@ -34,7 +34,7 @@ public function skipAction(): RedirectResponse public function invisibleAction(): RedirectResponse { - /** @var Program|null $object */ + /** @var Project|null $object */ $object = $this->admin->getSubject(); if (null === $object) { throw new NotFoundHttpException('Unable to find project'); @@ -71,7 +71,7 @@ private function getNextRandomApproveProjectId(): ?string $object_key = array_rand($objectsArray); $object = $objectsArray[$object_key]; - if (!$object instanceof Program) { + if (!$object instanceof Project) { return null; } diff --git a/src/Admin/Projects/ProjectPreUpdateTrait.php b/src/Admin/Projects/ProjectPreUpdateTrait.php index a5b95602b8..96d6c4565b 100644 --- a/src/Admin/Projects/ProjectPreUpdateTrait.php +++ b/src/Admin/Projects/ProjectPreUpdateTrait.php @@ -2,7 +2,7 @@ namespace App\Admin\Projects; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; use Sonata\AdminBundle\Exception\ModelManagerThrowable; use Sonata\DoctrineORMAdminBundle\Model\ModelManager; @@ -14,7 +14,7 @@ trait ProjectPreUpdateTrait */ public function preUpdate(object $object): void { - /** @var Program $object */ + /** @var Project $object */ /** @var ModelManager $model_manager */ $model_manager = $this->getModelManager(); $old_project = $model_manager->getEntityManager($this->getClass()) diff --git a/src/Admin/Projects/ProjectsAdmin.php b/src/Admin/Projects/ProjectsAdmin.php index 534f38a5b0..4e8451cbc6 100644 --- a/src/Admin/Projects/ProjectsAdmin.php +++ b/src/Admin/Projects/ProjectsAdmin.php @@ -2,7 +2,7 @@ namespace App\Admin\Projects; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; use App\Storage\ScreenshotRepository; use Sonata\AdminBundle\Admin\AbstractAdmin; @@ -22,7 +22,7 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; /** - * @phpstan-extends AbstractAdmin + * @phpstan-extends AbstractAdmin */ class ProjectsAdmin extends AbstractAdmin { @@ -63,7 +63,7 @@ public function getThumbnailImageUrl(mixed $object): string protected function configureFormFields(FormMapper $form): void { $form - ->add('name', TextType::class, ['label' => 'Program name']) + ->add('name', TextType::class, ['label' => 'Project name']) ->add('description') ->add('user', EntityType::class, ['class' => User::class]) ->add('flavor') diff --git a/src/Admin/Projects/ReportedProjects/ReportedProjectsAdmin.php b/src/Admin/Projects/ReportedProjects/ReportedProjectsAdmin.php index e0349b2a65..0601387db4 100644 --- a/src/Admin/Projects/ReportedProjects/ReportedProjectsAdmin.php +++ b/src/Admin/Projects/ReportedProjects/ReportedProjectsAdmin.php @@ -2,7 +2,7 @@ namespace App\Admin\Projects\ReportedProjects; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; use Sonata\AdminBundle\Admin\AbstractAdmin; use Sonata\AdminBundle\Datagrid\DatagridInterface; @@ -16,7 +16,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType as SymfonyChoiceType; /** - * @phpstan-extends AbstractAdmin + * @phpstan-extends AbstractAdmin */ class ReportedProjectsAdmin extends AbstractAdmin { @@ -48,7 +48,7 @@ protected function configureDatagridFilters(DatagridMapper $filter): void ]) ->add('category') ->add('reportingUser.username') - ->add('program.visible') + ->add('project.visible') ->add('reportedUser') ; } @@ -70,13 +70,13 @@ protected function configureListFields(ListMapper $list): void ->add('note', null, ['sortable' => false]) ->add('reportingUser', EntityType::class, ['class' => User::class]) ->add('reportedUser') - ->add('program', EntityType::class, + ->add('project', EntityType::class, [ - 'class' => Program::class, + 'class' => Project::class, 'editable' => false, ]) - ->add('program.visible') - ->add('program.approved', null, ['sortable' => false]) + ->add('project.visible') + ->add('project.approved', null, ['sortable' => false]) ->add(ListMapper::NAME_ACTIONS, null, ['actions' => [ 'unreportProgram' => ['template' => 'Admin/CRUD/list__action_unreportProject.html.twig'], 'acceptProgramReport' => ['template' => 'Admin/CRUD/list__action_accept_project_report.html.twig'], diff --git a/src/Admin/Projects/ReportedProjects/ReportedProjectsController.php b/src/Admin/Projects/ReportedProjects/ReportedProjectsController.php index daec40b962..7a772167ff 100644 --- a/src/Admin/Projects/ReportedProjects/ReportedProjectsController.php +++ b/src/Admin/Projects/ReportedProjects/ReportedProjectsController.php @@ -2,24 +2,24 @@ namespace App\Admin\Projects\ReportedProjects; -use App\DB\Entity\Project\ProgramInappropriateReport; +use App\DB\Entity\Project\ProjectInappropriateReport; use Sonata\AdminBundle\Controller\CRUDController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * @phpstan-extends CRUDController + * @phpstan-extends CRUDController */ class ReportedProjectsController extends CRUDController { public function unreportProjectAction(): RedirectResponse { - /** @var ProgramInappropriateReport|null $object */ + /** @var ProjectInappropriateReport|null $object */ $object = $this->admin->getSubject(); if (null === $object) { throw new NotFoundHttpException(); } - $project = $object->getProgram(); + $project = $object->getProject(); $project->setVisible(true); $project->setApproved(true); $object->setState(3); @@ -31,12 +31,12 @@ public function unreportProjectAction(): RedirectResponse public function acceptProjectReportAction(): RedirectResponse { - /** @var ProgramInappropriateReport|null $object */ + /** @var ProjectInappropriateReport|null $object */ $object = $this->admin->getSubject(); if (null === $object) { throw new NotFoundHttpException(); } - $project = $object->getProgram(); + $project = $object->getProject(); $project->setVisible(false); $project->setApproved(false); $object->setState(2); diff --git a/src/Admin/SpecialProjects/ExampleProjectAdmin.php b/src/Admin/SpecialProjects/ExampleProjectAdmin.php index 0614ec332c..f09e8a527a 100644 --- a/src/Admin/SpecialProjects/ExampleProjectAdmin.php +++ b/src/Admin/SpecialProjects/ExampleProjectAdmin.php @@ -3,8 +3,8 @@ namespace App\Admin\SpecialProjects; use App\DB\Entity\Flavor; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\Special\ExampleProgram; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\Special\ExampleProject; use App\DB\EntityRepository\FlavorRepository; use App\Project\ProjectManager; use App\Storage\ImageRepository; @@ -22,7 +22,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** - * @phpstan-extends AbstractAdmin + * @phpstan-extends AbstractAdmin */ class ExampleProjectAdmin extends AbstractAdmin { @@ -38,7 +38,7 @@ public function __construct( } /** - * @param ExampleProgram $object + * @param ExampleProject $object */ public function getExampleImageUrl($object): string { @@ -47,16 +47,16 @@ public function getExampleImageUrl($object): string public function getObjectMetadata($object): MetadataInterface { - /** @var ExampleProgram $example_project */ + /** @var ExampleProject $example_project */ $example_project = $object; - return new Metadata($example_project->getProgram()->getName(), $example_project->getProgram()->getDescription(), + return new Metadata($example_project->getProject()->getName(), $example_project->getProject()->getDescription(), $this->getExampleImageUrl($example_project)); } public function preUpdate(object $object): void { - /** @var ExampleProgram $example_project */ + /** @var ExampleProject $example_project */ $example_project = $object; $example_project->old_image_type = $example_project->getImageType(); @@ -76,7 +76,7 @@ protected function configureQuery(ProxyQueryInterface $query): ProxyQueryInterfa $qb = $query->getQueryBuilder(); $qb->andWhere( - $qb->expr()->isNotNull($qb->getRootAliases()[0].'.program') + $qb->expr()->isNotNull($qb->getRootAliases()[0].'.project') ); return $query; @@ -89,7 +89,7 @@ protected function configureQuery(ProxyQueryInterface $query): ProxyQueryInterfa */ protected function configureFormFields(FormMapper $form): void { - /** @var ExampleProgram $example_project */ + /** @var ExampleProject $example_project */ $example_project = $this->getSubject(); $file_options = [ 'required' => (null === $example_project->getId()), @@ -99,12 +99,12 @@ protected function configureFormFields(FormMapper $form): void if (null !== $this->getSubject()->getId()) { $file_options['help'] = ''; - $id_value = $this->getSubject()->getProgram()->getId(); + $id_value = $this->getSubject()->getProject()->getId(); } $form ->add('file', FileType::class, $file_options) - ->add('program_id', TextType::class, ['mapped' => false, 'data' => $id_value]) + ->add('project_id', TextType::class, ['mapped' => false, 'data' => $id_value]) ->add('flavor', null, ['class' => Flavor::class, 'choices' => $this->getFlavors(), 'required' => true]) ->add('priority') ->add('for_ios', null, ['label' => 'iOS only', 'required' => false, @@ -121,7 +121,7 @@ protected function configureFormFields(FormMapper $form): void protected function configureDatagridFilters(DatagridMapper $filter): void { $filter - ->add('program.name') + ->add('project.name') ; } @@ -140,7 +140,7 @@ protected function configureListFields(ListMapper $list): void 'accessor' => fn ($subject): string => $this->getExampleImageUrl($subject), 'template' => 'Admin/example_image.html.twig', ]) - ->add('program', EntityType::class, ['class' => Program::class, 'editable' => false]) + ->add('project', EntityType::class, ['class' => Project::class, 'editable' => false]) ->add('flavor', 'string') ->add('priority', 'integer') ->add('for_ios', null, ['label' => 'iOS only']) @@ -155,15 +155,15 @@ protected function configureListFields(ListMapper $list): void } /** - * @param ExampleProgram $object + * @param ExampleProject $object */ private function checkProjectID($object): void { - $id = $this->getForm()->get('program_id')->getData(); + $id = $this->getForm()->get('project_id')->getData(); $project = $this->project_manager->find($id); if (null !== $project) { - $object->setProgram($project); + $object->setProject($project); } else { throw new NotFoundHttpException(sprintf('Unable to find project with id : %s', $id)); } diff --git a/src/Admin/SpecialProjects/FeaturedProjectAdmin.php b/src/Admin/SpecialProjects/FeaturedProjectAdmin.php index 39e8654db8..8a0a431a2f 100644 --- a/src/Admin/SpecialProjects/FeaturedProjectAdmin.php +++ b/src/Admin/SpecialProjects/FeaturedProjectAdmin.php @@ -4,8 +4,8 @@ use App\Admin\SpecialProjects\Forms\FeaturedImageConstraint; use App\DB\Entity\Flavor; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\Special\FeaturedProgram; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\Special\FeaturedProject; use App\Project\ProjectManager; use App\Storage\ImageRepository; use Sonata\AdminBundle\Admin\AbstractAdmin; @@ -23,7 +23,7 @@ use Symfony\Component\Form\FormError; /** - * @phpstan-extends AbstractAdmin + * @phpstan-extends AbstractAdmin */ class FeaturedProjectAdmin extends AbstractAdmin { @@ -38,7 +38,7 @@ public function __construct( } /** - * @param FeaturedProgram $object + * @param FeaturedProject $object * * @return string */ @@ -49,16 +49,16 @@ public function getFeaturedImageUrl($object) public function getObjectMetadata($object): MetadataInterface { - /** @var FeaturedProgram $featured_project */ + /** @var FeaturedProject $featured_project */ $featured_project = $object; - return new Metadata($featured_project->getProgram()->getName(), $featured_project->getProgram()->getDescription(), + return new Metadata($featured_project->getProject()->getName(), $featured_project->getProject()->getDescription(), $this->getFeaturedImageUrl($featured_project)); } public function preUpdate(object $object): void { - /** @var FeaturedProgram $featured_project */ + /** @var FeaturedProject $featured_project */ $featured_project = $object; $featured_project->old_image_type = $featured_project->getImageType(); @@ -66,13 +66,13 @@ public function preUpdate(object $object): void public function preValidate(object $object): void { - $id = $this->getForm()->get('Program_Id_or_Url')->getData(); + $id = $this->getForm()->get('Project_Id_or_Url')->getData(); if ($this->getForm()->get('Use_Url')->getData()) { if (filter_var($id, FILTER_VALIDATE_URL)) { $object->setUrl($id); if (null !== $object->getId()) { - $object->setProgram(null); + $object->setProject(null); } } else { $this->getForm()->addError(new FormError('Please enter a valid URL.')); @@ -85,7 +85,7 @@ public function preValidate(object $object): void $project = $this->project_manager->find($id); if (null !== $project) { - $object->setProgram($project); + $object->setProject($project); if (null !== $object->getURL()) { $object->setURL(null); } @@ -102,7 +102,7 @@ public function preValidate(object $object): void */ protected function configureFormFields(FormMapper $form): void { - /** @var FeaturedProgram $featured_project */ + /** @var FeaturedProject $featured_project */ $featured_project = $this->getSubject(); $file_options = [ 'required' => (null === $featured_project->getId()), @@ -119,8 +119,8 @@ protected function configureFormFields(FormMapper $form): void $id_value = $this->getSubject()->getUrl(); $use_url = true; - if (null == $id_value && !is_null($this->getSubject()->getProgram())) { - $id_value = $this->getSubject()->getProgram()->getId(); + if (null == $id_value && !is_null($this->getSubject()->getProject())) { + $id_value = $this->getSubject()->getProject()->getId(); $use_url = false; } } else { @@ -129,8 +129,8 @@ protected function configureFormFields(FormMapper $form): void $form ->add('file', FileType::class, $file_options) ->add('Use_Url', CheckboxType::class, ['mapped' => false, 'required' => false, - 'help' => 'Toggle to save URL instead of Program ID.', 'data' => $use_url, ]) - ->add('Program_Id_or_Url', TextType::class, ['mapped' => false, 'data' => $id_value]) + 'help' => 'Toggle to save URL instead of Project ID.', 'data' => $use_url, ]) + ->add('Project_Id_or_Url', TextType::class, ['mapped' => false, 'data' => $id_value]) ->add('flavor', null, ['class' => Flavor::class, 'multiple' => false, 'required' => true]) ->add('priority') ->add('for_ios', null, ['label' => 'iOS only', 'required' => false, @@ -147,7 +147,7 @@ protected function configureFormFields(FormMapper $form): void protected function configureDatagridFilters(DatagridMapper $filter): void { $filter - ->add('program.name') + ->add('project.name') ->add('for_ios') ->add('active') ->add('priority') @@ -171,8 +171,8 @@ protected function configureListFields(ListMapper $list): void 'accessor' => fn ($subject): string => $this->getFeaturedImageUrl($subject), 'template' => 'Admin/featured_image.html.twig', ]) - ->add('program', EntityType::class, [ - 'class' => Program::class, + ->add('project', EntityType::class, [ + 'class' => Project::class, 'editable' => false, ]) ->add('url', UrlType::class) diff --git a/src/Admin/Statistics/Translation/ProjectCustomTranslationAdmin.php b/src/Admin/Statistics/Translation/ProjectCustomTranslationAdmin.php index e19d621af9..bae7f0f8e8 100644 --- a/src/Admin/Statistics/Translation/ProjectCustomTranslationAdmin.php +++ b/src/Admin/Statistics/Translation/ProjectCustomTranslationAdmin.php @@ -2,7 +2,7 @@ namespace App\Admin\Statistics\Translation; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\Translation\ProjectCustomTranslation; use Sonata\AdminBundle\Admin\AbstractAdmin; use Sonata\AdminBundle\Datagrid\ListMapper; @@ -55,7 +55,7 @@ protected function configureListFields(ListMapper $list): void protected function configureFormFields(FormMapper $form): void { $form - ->add('project', EntityType::class, ['class' => Program::class], [ + ->add('project', EntityType::class, ['class' => Project::class], [ 'admin_code' => 'admin.block.projects.overview', ]) ->add('language') diff --git a/src/Admin/Users/ReportedUsers/ReportedUsersAdmin.php b/src/Admin/Users/ReportedUsers/ReportedUsersAdmin.php index f292d9ee68..1cd99d53a8 100644 --- a/src/Admin/Users/ReportedUsers/ReportedUsersAdmin.php +++ b/src/Admin/Users/ReportedUsers/ReportedUsersAdmin.php @@ -33,8 +33,8 @@ protected function configureQuery(ProxyQueryInterface $query): ProxyQueryInterfa if (isset($parameters['_sort_by']) && 'getReportedCommentsCount' === $parameters['_sort_by']) { $qb ->leftJoin(\App\DB\Entity\User\Comment\UserComment::class, 'user_comment', Join::WITH, $rootAlias.'.id=user_comment.user') - ->leftJoin(\App\DB\Entity\Project\Program::class, 'p', Join::WITH, $rootAlias.'.id = p.user') - ->leftJoin(\App\DB\Entity\Project\ProgramInappropriateReport::class, 'repProg', Join::WITH, 'p.id = repProg.program') + ->leftJoin(\App\DB\Entity\Project\Project::class, 'p', Join::WITH, $rootAlias.'.id = p.user') + ->leftJoin(\App\DB\Entity\Project\ProjectInappropriateReport::class, 'repProg', Join::WITH, 'p.id = repProg.project') ->where($qb->expr()->eq('user_comment.isReported', '1')) ->groupBy($rootAlias.'.id') ->orderBy('COUNT(user_comment.user )', $parameters['_sort_order']) @@ -42,18 +42,18 @@ protected function configureQuery(ProxyQueryInterface $query): ProxyQueryInterfa } elseif (isset($parameters['_sort_by']) && 'getReportsOfThisUserCount' === $parameters['_sort_by']) { $qb ->leftJoin(\App\DB\Entity\User\Comment\UserComment::class, 'user_comment', Join::WITH, $rootAlias.'.id=user_comment.user') - ->leftJoin(\App\DB\Entity\Project\Program::class, 'p', Join::WITH, $rootAlias.'.id = p.user') - ->leftJoin(\App\DB\Entity\Project\ProgramInappropriateReport::class, 'repProg', Join::WITH, 'p.id = repProg.program') - ->where($qb->expr()->isNotNull('repProg.program')) + ->leftJoin(\App\DB\Entity\Project\Project::class, 'p', Join::WITH, $rootAlias.'.id = p.user') + ->leftJoin(\App\DB\Entity\Project\ProjectInappropriateReport::class, 'repProg', Join::WITH, 'p.id = repProg.project') + ->where($qb->expr()->isNotNull('repProg.project')) ->groupBy($rootAlias.'.id') - ->orderBy('COUNT(repProg.program)', $parameters['_sort_order']) + ->orderBy('COUNT(repProg.project)', $parameters['_sort_order']) ; } else { $qb ->leftJoin(\App\DB\Entity\User\Comment\UserComment::class, 'user_comment', Join::WITH, $rootAlias.'.id=user_comment.user') - ->leftJoin(\App\DB\Entity\Project\Program::class, 'p', Join::WITH, $rootAlias.'.id = p.user') - ->leftJoin(\App\DB\Entity\Project\ProgramInappropriateReport::class, 'repProg', Join::WITH, 'p.id = repProg.program') - ->where($qb->expr()->eq('user_comment.isReported', '1'))->orWhere($qb->expr()->isNotNull('repProg.program')) + ->leftJoin(\App\DB\Entity\Project\Project::class, 'p', Join::WITH, $rootAlias.'.id = p.user') + ->leftJoin(\App\DB\Entity\Project\ProjectInappropriateReport::class, 'repProg', Join::WITH, 'p.id = repProg.project') + ->where($qb->expr()->eq('user_comment.isReported', '1'))->orWhere($qb->expr()->isNotNull('repProg.project')) ; } @@ -68,7 +68,7 @@ protected function configureListFields(ListMapper $list): void ->add('email') ->add(ListMapper::NAME_ACTIONS, null, ['actions' => [ 'createUrlComments' => ['template' => 'Admin/CRUD/list__action_create_url_comments.html.twig'], - 'createUrlProjects' => ['template' => 'Admin/CRUD/list__action_create_url_programs.html.twig'], + 'createUrlProjects' => ['template' => 'Admin/CRUD/list__action_create_url_projects.html.twig'], ]]) ->add( 'getReportedCommentsCount', diff --git a/src/Admin/Users/UserDataReport/UserDataReportController.php b/src/Admin/Users/UserDataReport/UserDataReportController.php index 4a92e310d2..ffe492860d 100644 --- a/src/Admin/Users/UserDataReport/UserDataReportController.php +++ b/src/Admin/Users/UserDataReport/UserDataReportController.php @@ -50,7 +50,7 @@ protected function getUserNotifications(string $user_id): array protected function getReportedProjects(string $user_id): mixed { return $this->entity_manager - ->createQuery(sprintf('SELECT pir FROM App\DB\Entity\Project\ProgramInappropriateReport pir WHERE pir.reportingUser=\'%s\'', $user_id)) + ->createQuery(sprintf('SELECT pir FROM App\DB\Entity\Project\ProjectInappropriateReport pir WHERE pir.reportingUser=\'%s\'', $user_id)) ->getResult() ; } @@ -66,7 +66,7 @@ protected function getUserComments(string $user_id): mixed protected function getUserProjects(string $user_id): mixed { return $this->entity_manager - ->createQuery(sprintf('SELECT up FROM App\DB\Entity\Project\Program up WHERE up.user=\'%s\'', $user_id)) + ->createQuery(sprintf('SELECT up FROM App\DB\Entity\Project\Project up WHERE up.user=\'%s\'', $user_id)) ->getResult() ; } diff --git a/src/Api/ProjectsApi.php b/src/Api/ProjectsApi.php index 9647e92e73..8a648cccb3 100644 --- a/src/Api/ProjectsApi.php +++ b/src/Api/ProjectsApi.php @@ -4,7 +4,7 @@ use App\Api\Services\Base\AbstractApiController; use App\Api\Services\Projects\ProjectsApiFacade; -use App\DB\Entity\Project\ProgramDownloads; +use App\DB\Entity\Project\ProjectDownloads; use App\Project\AddProjectRequest; use App\Project\Event\ProjectDownloadEvent; use OpenAPI\Server\Api\ProjectsApiInterface; @@ -367,7 +367,7 @@ public function customProjectIdCatrobatGet(string $id, int &$responseCode, array $user = $this->facade->getAuthenticationManager()->getAuthenticatedUser(); $this->facade->getEventDispatcher()->dispatch( - new ProjectDownloadEvent($user, $project, ProgramDownloads::TYPE_PROJECT) + new ProjectDownloadEvent($user, $project, ProjectDownloads::TYPE_PROJECT) ); return $response; diff --git a/src/Api/Services/Notifications/NotificationsResponseManager.php b/src/Api/Services/Notifications/NotificationsResponseManager.php index 905d2710b9..432018e32f 100644 --- a/src/Api/Services/Notifications/NotificationsResponseManager.php +++ b/src/Api/Services/Notifications/NotificationsResponseManager.php @@ -8,7 +8,7 @@ use App\DB\Entity\User\Notifications\CommentNotification; use App\DB\Entity\User\Notifications\FollowNotification; use App\DB\Entity\User\Notifications\LikeNotification; -use App\DB\Entity\User\Notifications\NewProgramNotification; +use App\DB\Entity\User\Notifications\NewProjectNotification; use App\DB\Entity\User\Notifications\RemixNotification; use App\DB\Entity\User\User; use App\DB\EntityRepository\User\Notification\NotificationRepository; @@ -42,7 +42,7 @@ public function createNotificationsCountResponse(User $user): NotificationsCount if ($notification instanceof LikeNotification) { ++$likes; - } elseif ($notification instanceof FollowNotification || $notification instanceof NewProgramNotification) { + } elseif ($notification instanceof FollowNotification || $notification instanceof NewProjectNotification) { ++$followers; } elseif ($notification instanceof CommentNotification) { ++$comments; diff --git a/src/Api/Services/Projects/ProjectsApiLoader.php b/src/Api/Services/Projects/ProjectsApiLoader.php index 1b08092192..0ea619777f 100644 --- a/src/Api/Services/Projects/ProjectsApiLoader.php +++ b/src/Api/Services/Projects/ProjectsApiLoader.php @@ -3,7 +3,7 @@ namespace App\Api\Services\Projects; use App\Api\Services\Base\AbstractApiLoader; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; use App\DB\EntityRepository\Project\ExtensionRepository; use App\DB\EntityRepository\Project\Special\FeaturedRepository; @@ -35,7 +35,7 @@ public function findProjectsByID(string $id, bool $include_private = false): arr return $this->project_manager->getProjectByID($id, $include_private); } - public function findProjectByID(string $id, bool $include_private = false): ?Program + public function findProjectByID(string $id, bool $include_private = false): ?Project { $projects = $this->findProjectsByID($id, $include_private); @@ -62,7 +62,7 @@ public function getProjectsFromCategory(string $category, string $max_version, i public function getFeaturedProjects(?string $flavor, int $limit, int $offset, string $platform, string $max_version): mixed { - return $this->featured_repository->getFeaturedPrograms($flavor, $limit, $offset, $platform, $max_version); + return $this->featured_repository->getFeaturedProjects($flavor, $limit, $offset, $platform, $max_version); } public function getRecommendedProjects(string $project_id, string $category, string $max_version, int $limit, int $offset, string $flavor, ?User $user): array @@ -75,8 +75,8 @@ public function getRecommendedProjects(string $project_id, string $category, str return []; // Features removed case 'more_from_user': - /** @var Program $project */ - $project = $project->isExample() ? $project->getProgram() : $project; + /** @var Project $project */ + $project = $project->isExample() ? $project->getProject() : $project; $project_user_id = $project->getUser()->getId(); return $this->project_manager->getMoreProjectsFromUser($project_user_id, $project_id, $limit, $offset, $flavor, $max_version); diff --git a/src/Api/Services/Projects/ProjectsApiProcessor.php b/src/Api/Services/Projects/ProjectsApiProcessor.php index c8b909bc64..e303bd33c4 100644 --- a/src/Api/Services/Projects/ProjectsApiProcessor.php +++ b/src/Api/Services/Projects/ProjectsApiProcessor.php @@ -3,7 +3,7 @@ namespace App\Api\Services\Projects; use App\Api\Services\Base\AbstractApiProcessor; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; use App\Project\AddProjectRequest; use App\Project\CatrobatFile\ExtractedFileRepository; @@ -29,17 +29,17 @@ public function __construct(private readonly ProjectManager $project_manager, /** * @throws \Exception */ - public function addProject(AddProjectRequest $add_program_request): ?Program + public function addProject(AddProjectRequest $add_program_request): ?Project { return $this->project_manager->addProject($add_program_request); } - public function saveProject(Program $project): void + public function saveProject(Project $project): void { $this->project_manager->save($project); } - public function updateProject(Program $project, UpdateProjectRequest $request): bool|int + public function updateProject(Project $project, UpdateProjectRequest $request): bool|int { $project_touched = false; $extracted_file = null; diff --git a/src/Api/Services/Projects/ProjectsResponseManager.php b/src/Api/Services/Projects/ProjectsResponseManager.php index 99066d2ce0..d49c38e087 100644 --- a/src/Api/Services/Projects/ProjectsResponseManager.php +++ b/src/Api/Services/Projects/ProjectsResponseManager.php @@ -6,8 +6,8 @@ use App\Api\Services\Base\TranslatorAwareTrait; use App\Api\Services\ResponseCache\ResponseCacheManager; use App\DB\Entity\Project\Extension; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\Special\FeaturedProgram; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\Special\FeaturedProject; use App\DB\Entity\Project\Tag; use App\Project\ProjectManager; use App\Storage\ImageRepository; @@ -45,7 +45,7 @@ public function __construct( /** * @param ?string $attributes Comma-separated list of attributes to include into response */ - public function createProjectDataResponse(Program $project, ?string $attributes): ProjectResponse + public function createProjectDataResponse(Project $project, ?string $attributes): ProjectResponse { if (empty($attributes)) { $attributes_list = ['id', 'name', 'author', 'views', 'downloads', 'flavor', 'uploaded_string', 'screenshot_large', 'screenshot_small', 'project_url']; @@ -65,8 +65,8 @@ public function createProjectDataResponse(Program $project, ?string $attributes) $attributes_list = explode(',', $attributes); } - /** @var Program $extraced_project */ - $extraced_project = $project->isExample() ? $project->getProgram() : $project; + /** @var Project $extraced_project */ + $extraced_project = $project->isExample() ? $project->getProject() : $project; $data = []; @@ -135,7 +135,7 @@ public function createProjectDataResponse(Program $project, ?string $attributes) $data['screenshot_small'] = $project->isExample() ? $this->image_repository->getAbsoluteWebPath($project->getId(), $project->getImageType(), false) : $this->project_manager->getScreenshotSmall($extraced_project->getId()); } if (in_array('project_url', $attributes_list, true)) { - $data['project_url'] = ltrim($this->createProjectLocation($project->getProgram()), '/'); + $data['project_url'] = ltrim($this->createProjectLocation($project->getProject()), '/'); } if (in_array('download_url', $attributes_list, true)) { $data['download_url'] = ltrim($this->url_generator->generate( @@ -162,7 +162,7 @@ public function createProjectsDataResponse(array $projects, string $attributes = return $response; } - public function createFeaturedProjectResponse(FeaturedProgram $featured_project, string $attributes = null): FeaturedProjectResponse + public function createFeaturedProjectResponse(FeaturedProject $featured_project, string $attributes = null): FeaturedProjectResponse { if (empty($attributes) || 'ALL' === $attributes) { $attributes_list = ['id', 'project_id', 'project_url', 'url', 'name', 'author', 'featured_image']; @@ -175,13 +175,13 @@ public function createFeaturedProjectResponse(FeaturedProgram $featured_project, $data['id'] = $featured_project->getId() ?? -1; } if (in_array('project_id', $attributes_list, true)) { - $data['project_id'] = $featured_project->getProgram()->getId() ?? ''; + $data['project_id'] = $featured_project->getProject()->getId() ?? ''; } if (in_array('name', $attributes_list, true)) { - $data['name'] = $featured_project->getProgram()->getName(); + $data['name'] = $featured_project->getProject()->getName(); } if (in_array('author', $attributes_list, true)) { - $data['author'] = $featured_project->getProgram()->getUser()->getUserIdentifier(); + $data['author'] = $featured_project->getProject()->getUser()->getUserIdentifier(); } if (in_array('featured_image', $attributes_list, true)) { $data['featured_image'] = $this->image_repository->getAbsoluteWebPath($featured_project->getId(), $featured_project->getImageType(), true); @@ -191,7 +191,7 @@ public function createFeaturedProjectResponse(FeaturedProgram $featured_project, $url = $featured_project->getUrl(); $project_url = null; if (empty($url)) { - $url = $project_url = ltrim($this->createProjectLocation($featured_project->getProgram()), '/'); + $url = $project_url = ltrim($this->createProjectLocation($featured_project->getProject()), '/'); } if (in_array('project_url', $attributes_list, true)) { @@ -209,7 +209,7 @@ public function createFeaturedProjectsResponse(array $featured_projects, string { $response = []; - /** @var FeaturedProgram $featured_project */ + /** @var FeaturedProject $featured_project */ foreach ($featured_projects as $featured_project) { $response[] = $this->createFeaturedProjectResponse($featured_project, $attributes); } @@ -226,7 +226,7 @@ public function createProjectCategoryResponse(array $projects, string $category, ]); } - public function createProjectLocation(Program $project): string + public function createProjectLocation(Project $project): string { return $this->url_generator->generate( 'program', diff --git a/src/Api/Services/Search/SearchResponseManager.php b/src/Api/Services/Search/SearchResponseManager.php index db6f2dbfb0..8b4241d3ef 100644 --- a/src/Api/Services/Search/SearchResponseManager.php +++ b/src/Api/Services/Search/SearchResponseManager.php @@ -5,7 +5,7 @@ use App\Api\Services\Base\AbstractResponseManager; use App\Api\Services\Projects\ProjectsResponseManager; use App\Api\Services\ResponseCache\ResponseCacheManager; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; use OpenAPI\Server\Model\BasicUserDataResponse; use OpenAPI\Server\Model\ProjectResponse; @@ -53,7 +53,7 @@ public function getBasicUserDataResponse(User $user): BasicUserDataResponse return new BasicUserDataResponse([ 'id' => $user->getId(), 'username' => $user->getUsername(), - 'projects' => $user->getPrograms()->count(), + 'projects' => $user->getProjects()->count(), 'followers' => $user->getFollowers()->count(), 'following' => $user->getFollowing()->count(), ]); @@ -65,7 +65,7 @@ public function getProjectsSearchResponse(array $projects, int $total): array $projects_data_response['projects'] = []; $projects_data_response['projects_total'] = $total; - /** @var Program $project */ + /** @var Project $project */ foreach ($projects as $project) { $project_data = $this->getProjectDataResponse($project); $projects_data_response['projects'][] = $project_data; @@ -74,7 +74,7 @@ public function getProjectsSearchResponse(array $projects, int $total): array return $projects_data_response; } - public function getProjectDataResponse(Program $project): ProjectResponse + public function getProjectDataResponse(Project $project): ProjectResponse { return $this->projectsResponseManager->createProjectDataResponse($project, null); } diff --git a/src/Api/Services/User/UserResponseManager.php b/src/Api/Services/User/UserResponseManager.php index d88807d6af..503ee94654 100644 --- a/src/Api/Services/User/UserResponseManager.php +++ b/src/Api/Services/User/UserResponseManager.php @@ -73,7 +73,7 @@ private function createBasicUserDataArray(User $user, array $attributes_list): a $data['currently_working_on'] = $user->getCurrentlyWorkingOn() ?? ''; } if (in_array('projects', $attributes_list, true)) { - $data['projects'] = $user->getPrograms()->count(); + $data['projects'] = $user->getProjects()->count(); } if (in_array('followers', $attributes_list, true)) { $data['followers'] = $user->getFollowers()->count(); diff --git a/src/Api_deprecated/Controller/FeaturedController.php b/src/Api_deprecated/Controller/FeaturedController.php index 8865465bdc..a0ce4d7d18 100644 --- a/src/Api_deprecated/Controller/FeaturedController.php +++ b/src/Api_deprecated/Controller/FeaturedController.php @@ -2,7 +2,7 @@ namespace App\Api_deprecated\Controller; -use App\DB\Entity\Project\Special\FeaturedProgram; +use App\DB\Entity\Project\Special\FeaturedProject; use App\DB\EntityRepository\Project\Special\FeaturedRepository; use App\Storage\ImageRepository; use Doctrine\ORM\NonUniqueResultException; @@ -44,8 +44,8 @@ private function getFeaturedProjects(Request $request, bool $ios_only, ImageRepo $platform = 'ios'; } - $featured_projects = $repository->getFeaturedPrograms($flavor, $limit, $offset, $platform); - $numbOfTotalProjects = $repository->getFeaturedProgramCount($flavor, $ios_only); + $featured_projects = $repository->getFeaturedProjects($flavor, $limit, $offset, $platform); + $numbOfTotalProjects = $repository->getFeaturedProjectCount($flavor, $ios_only); $retArray = []; $retArray['CatrobatProjects'] = []; @@ -62,12 +62,12 @@ private function getFeaturedProjects(Request $request, bool $ios_only, ImageRepo return new JsonResponse($retArray); } - private function generateProjectObject(FeaturedProgram $featured_project, ImageRepository $image_repository): array + private function generateProjectObject(FeaturedProject $featured_project, ImageRepository $image_repository): array { $new_project = []; - $new_project['ProjectId'] = $featured_project->getProgram()->getId(); - $new_project['ProjectName'] = $featured_project->getProgram()->getName(); - $new_project['Author'] = $featured_project->getProgram() + $new_project['ProjectId'] = $featured_project->getProject()->getId(); + $new_project['ProjectName'] = $featured_project->getProject()->getName(); + $new_project['Author'] = $featured_project->getProject() ->getUser() ->getUserIdentifier() ; diff --git a/src/Api_deprecated/Controller/ProjectController.php b/src/Api_deprecated/Controller/ProjectController.php index 4b67fe2daf..e5bae514dc 100644 --- a/src/Api_deprecated/Controller/ProjectController.php +++ b/src/Api_deprecated/Controller/ProjectController.php @@ -4,7 +4,7 @@ use App\Api_deprecated\Responses\ProjectListResponse; use App\Application\Twig\TwigExtension; -use App\DB\Entity\Project\ProgramLike; +use App\DB\Entity\Project\ProjectLike; use App\Project\ProjectManager; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; @@ -50,7 +50,7 @@ public function projectLikesAction(string $id, ProjectManager $project_manager): } $data = []; $user_objects = []; - /** @var ProgramLike $like */ + /** @var ProjectLike $like */ foreach ($project->getLikes()->getIterator() as $like) { if (array_key_exists($like->getUser()->getId(), $user_objects)) { $obj = $user_objects[$like->getUser()->getId()]; @@ -88,8 +88,8 @@ public function projectLikesCountAction(Request $request, string $id, ProjectMan $data->total->stringValue = TwigExtension::humanFriendlyNumber( $data->total->value, $translator, $user_locale ); - foreach (ProgramLike::$VALID_TYPES as $type_id) { - $type_name = ProgramLike::$TYPE_NAMES[$type_id]; + foreach (ProjectLike::$VALID_TYPES as $type_id) { + $type_name = ProjectLike::$TYPE_NAMES[$type_id]; $data->{$type_name} = new \stdClass(); $data->{$type_name}->value = $project_manager->likeTypeCount($id, $type_id); $data->{$type_name}->stringValue = TwigExtension::humanFriendlyNumber( diff --git a/src/Api_deprecated/Controller/ReportController.php b/src/Api_deprecated/Controller/ReportController.php index 1889a732ce..dcae91e8e2 100644 --- a/src/Api_deprecated/Controller/ReportController.php +++ b/src/Api_deprecated/Controller/ReportController.php @@ -2,8 +2,8 @@ namespace App\Api_deprecated\Controller; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\ProgramInappropriateReport; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\ProjectInappropriateReport; use App\DB\Entity\User\User; use App\Project\Event\ReportInsertEvent; use App\Project\ProjectManager; @@ -41,10 +41,10 @@ public function __construct( #[Route(path: '/api/reportProject/reportProject.json', name: 'catrobat_api_report_program', defaults: ['_format' => 'json'], methods: ['POST', 'GET'])] public function reportProjectAction(Request $request): JsonResponse { - /* @var $project Program */ + /* @var $project Project */ /* @var $user User */ $response = []; - if (!$request->request->get('program') || !$request->request->get('category') || !$request->request->get('note')) { + if (!$request->request->get('project') || !$request->request->get('category') || !$request->request->get('note')) { $response['statusCode'] = 501; // should be a bad request! $response['answer'] = $this->translator->trans('errors.post-data', [], 'catroweb'); $response['preHeaderMessages'] = ''; @@ -53,7 +53,7 @@ public function reportProjectAction(Request $request): JsonResponse } $category = strval($request->request->get('category')); $note = strval($request->request->get('note')); - $projectId = strval($request->request->get('program')); + $projectId = strval($request->request->get('project')); $project = $this->project_manager->find($projectId); if (null == $project) { $response['statusCode'] = 506; // should be 404! @@ -62,7 +62,7 @@ public function reportProjectAction(Request $request): JsonResponse return new JsonResponse($response); } - $report = new ProgramInappropriateReport(); + $report = new ProjectInappropriateReport(); $approved_project = $project->getApproved(); $featured_project = $this->project_manager->getFeaturedRepository()->isFeatured($project); if ($approved_project || $featured_project) { @@ -99,7 +99,7 @@ public function reportProjectAction(Request $request): JsonResponse $project->setVisible(false); $report->setCategory($category); $report->setNote($note); - $report->setProgram($project); + $report->setProject($project); $report->setReportedUser($project->getUser()); $this->entity_manager->persist($report); $this->entity_manager->flush(); diff --git a/src/Api_deprecated/Controller/UploadController.php b/src/Api_deprecated/Controller/UploadController.php index 17df344c4f..0f2fbd3088 100644 --- a/src/Api_deprecated/Controller/UploadController.php +++ b/src/Api_deprecated/Controller/UploadController.php @@ -2,7 +2,7 @@ namespace App\Api_deprecated\Controller; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; use App\Project\AddProjectRequest; use App\Project\CatrobatFile\InvalidCatrobatFileException; @@ -108,7 +108,7 @@ private function trans(string $message, array $parameters = []): string return $this->translator->trans($message, $parameters, 'catroweb'); } - private function createUploadResponse(Request $request, User $user, Program $project): array + private function createUploadResponse(Request $request, User $user, Project $project): array { $response = []; $this->user_manager->updateUser($user); @@ -117,7 +117,7 @@ private function createUploadResponse(Request $request, User $user, Program $pro $response['statusCode'] = Response::HTTP_OK; $response['answer'] = $this->trans('success.upload'); $response['token'] = $user->getUploadToken(); - $request->attributes->set('program_id', $project->getId()); + $request->attributes->set('project_id', $project->getId()); $response['preHeaderMessages'] = ''; return $response; @@ -133,7 +133,7 @@ private function createUploadFailedResponse(Request $request, User $user): array $response['answer'] = $this->trans('failure.upload'); $response['token'] = $user->getUploadToken(); - $request->attributes->set('program_id', 0); + $request->attributes->set('project_id', 0); $response['preHeaderMessages'] = ''; return $response; diff --git a/src/Api_deprecated/Listeners/ProjectListSerializerEventSubscriber.php b/src/Api_deprecated/Listeners/ProjectListSerializerEventSubscriber.php index 8cedf01bbd..77a0160839 100644 --- a/src/Api_deprecated/Listeners/ProjectListSerializerEventSubscriber.php +++ b/src/Api_deprecated/Listeners/ProjectListSerializerEventSubscriber.php @@ -3,7 +3,7 @@ namespace App\Api_deprecated\Listeners; use App\Api_deprecated\Responses\ProjectListResponse; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Storage\ImageRepository; use App\Storage\ScreenshotRepository; use App\Utils\ElapsedTimeStringFormatter; @@ -37,7 +37,7 @@ public function onKernelView(ViewEvent $event): void $retArray = []; $retArray['CatrobatProjects'] = []; - /** @var Program $project */ + /** @var Project $project */ foreach ($projects as $project) { $new_project = []; $example = false; @@ -45,7 +45,7 @@ public function onKernelView(ViewEvent $event): void $new_project['ExampleId'] = $project->getId(); $new_project['Extension'] = $project->getImageType(); $example = true; - $project = $project->getProgram(); + $project = $project->getProject(); } $new_project['ProjectId'] = $project->getId(); $new_project['ProjectName'] = $project->getName(); diff --git a/src/Application/Controller/Base/IndexController.php b/src/Application/Controller/Base/IndexController.php index 5fce7d55a8..e0c7c34901 100644 --- a/src/Application/Controller/Base/IndexController.php +++ b/src/Application/Controller/Base/IndexController.php @@ -3,7 +3,7 @@ namespace App\Application\Controller\Base; use App\DB\Entity\MaintenanceInformation; -use App\DB\Entity\Project\Special\FeaturedProgram; +use App\DB\Entity\Project\Special\FeaturedProject; use App\DB\Entity\User\User; use App\DB\EntityRepository\Project\Special\FeaturedRepository; use App\Storage\ImageRepository; @@ -44,15 +44,15 @@ protected function getFeaturedSliderData(string $flavor): array } $featuredData = []; - /** @var FeaturedProgram $item */ + /** @var FeaturedProject $item */ foreach ($featured_items as $item) { $info = []; - if (null !== $item->getProgram()) { + if (null !== $item->getProject()) { if ($flavor) { $info['url'] = $this->generateUrl('program', - ['id' => $item->getProgram()->getId(), 'theme' => $flavor]); + ['id' => $item->getProject()->getId(), 'theme' => $flavor]); } else { - $info['url'] = $this->generateUrl('program', ['id' => $item->getProgram()->getId()]); + $info['url'] = $this->generateUrl('program', ['id' => $item->getProject()->getId()]); } } else { $info['url'] = $item->getUrl(); diff --git a/src/Application/Controller/Ci/ApkStatusController.php b/src/Application/Controller/Ci/ApkStatusController.php index 3c7aa99222..27aa8ab247 100644 --- a/src/Application/Controller/Ci/ApkStatusController.php +++ b/src/Application/Controller/Ci/ApkStatusController.php @@ -2,7 +2,7 @@ namespace App\Application\Controller\Ci; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Project\ProjectManager; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; @@ -25,20 +25,20 @@ public function __construct(private readonly ProjectManager $project_manager, pr #[Route(path: '/ci/status/{id}', name: 'ci_status', defaults: ['_format' => 'json'], methods: ['GET'])] public function getApkStatusAction(string $id): JsonResponse { - /** @var Program|null $project */ + /** @var Project|null $project */ $project = $this->project_manager->findProjectIfVisibleToCurrentUser($id); if (null === $project) { return new JsonResponse(null, Response::HTTP_NOT_FOUND); } $result = []; switch ($project->getApkStatus()) { - case Program::APK_READY: + case Project::APK_READY: $result['status'] = 'ready'; $result['url'] = $this->generateUrl('ci_download', ['id' => $project->getId(), 'fname' => $project->getName()], UrlGeneratorInterface::ABSOLUTE_URL); $result['label'] = $this->translator->trans('ci.download', [], 'catroweb'); break; - case Program::APK_PENDING: + case Project::APK_PENDING: $result['status'] = 'pending'; $result['label'] = $this->translator->trans('ci.pending', [], 'catroweb'); break; diff --git a/src/Application/Controller/Ci/BuildApkController.php b/src/Application/Controller/Ci/BuildApkController.php index f2423210c4..b45126c3db 100644 --- a/src/Application/Controller/Ci/BuildApkController.php +++ b/src/Application/Controller/Ci/BuildApkController.php @@ -2,7 +2,7 @@ namespace App\Application\Controller\Ci; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Project\Apk\ApkRepository; use App\Project\Apk\JenkinsDispatcher; use App\Project\ProjectManager; @@ -35,19 +35,19 @@ public function __construct( #[Route(path: '/ci/build/{id}', name: 'ci_build', defaults: ['_format' => 'json'], methods: ['GET'])] public function createApkAction(string $id): JsonResponse { - /** @var Program|null $project */ + /** @var Project|null $project */ $project = $this->project_manager->find($id); if (null === $project || !$project->isVisible()) { throw $this->createNotFoundException(); } - if (Program::APK_READY === $project->getApkStatus()) { + if (Project::APK_READY === $project->getApkStatus()) { return new JsonResponse(['status' => 'ready']); } - if (Program::APK_PENDING === $project->getApkStatus()) { + if (Project::APK_PENDING === $project->getApkStatus()) { return new JsonResponse(['status' => 'pending']); } $this->dispatcher->sendBuildRequest($project->getId()); - $project->setApkStatus(Program::APK_PENDING); + $project->setApkStatus(Project::APK_PENDING); $project->setApkRequestTime(TimeUtils::getDateTime()); $this->project_manager->save($project); @@ -57,7 +57,7 @@ public function createApkAction(string $id): JsonResponse #[Route(path: '/ci/upload/{id}', name: 'ci_upload_apk', defaults: ['_format' => 'json'], methods: ['GET', 'POST'])] public function uploadApkAction(string $id, Request $request): JsonResponse { - /** @var Program|null $project */ + /** @var Project|null $project */ $project = $this->project_manager->find($id); if (null === $project || !$project->isVisible()) { throw $this->createNotFoundException(); @@ -71,7 +71,7 @@ public function uploadApkAction(string $id, Request $request): JsonResponse } $file = array_values($request->files->all())[0]; $this->apk_repository->save($file, $project->getId()); - $project->setApkStatus(Program::APK_READY); + $project->setApkStatus(Project::APK_READY); $this->project_manager->save($project); return new JsonResponse(['result' => 'success']); @@ -80,7 +80,7 @@ public function uploadApkAction(string $id, Request $request): JsonResponse #[Route(path: '/ci/failed/{id}', name: 'ci_failed_apk', defaults: ['_format' => 'json'], methods: ['GET'])] public function failedApkAction(string $id, Request $request): JsonResponse { - /** @var Program|null $project */ + /** @var Project|null $project */ $project = $this->project_manager->find($id); if (null === $project || !$project->isVisible()) { throw $this->createNotFoundException(); @@ -89,8 +89,8 @@ public function failedApkAction(string $id, Request $request): JsonResponse if ($request->query->get('token') !== $config['uploadtoken']) { throw new AccessDeniedException(); } - if (Program::APK_PENDING === $project->getApkStatus()) { - $project->setApkStatus(Program::APK_NONE); + if (Project::APK_PENDING === $project->getApkStatus()) { + $project->setApkStatus(Project::APK_NONE); $this->project_manager->save($project); return new JsonResponse(['OK']); diff --git a/src/Application/Controller/Ci/DownloadApkController.php b/src/Application/Controller/Ci/DownloadApkController.php index 03ef815c0a..1c43b1f210 100644 --- a/src/Application/Controller/Ci/DownloadApkController.php +++ b/src/Application/Controller/Ci/DownloadApkController.php @@ -2,8 +2,8 @@ namespace App\Application\Controller\Ci; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\ProgramDownloads; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\ProjectDownloads; use App\DB\Entity\User\User; use App\Project\Apk\ApkRepository; use App\Project\Event\ProjectDownloadEvent; @@ -42,7 +42,7 @@ public function downloadApkAction(string $id, Request $request): BinaryFileRespo $file = $this->getApkFile($id); $response = $this->createDownloadApkFileResponse($id, $file); $this->event_dispatcher->dispatch( - new ProjectDownloadEvent($user, $project, ProgramDownloads::TYPE_APK) + new ProjectDownloadEvent($user, $project, ProjectDownloads::TYPE_APK) ); return $response; @@ -73,7 +73,7 @@ protected function getApkFile(string $id): File } catch (\Exception $exception) { $project = $this->project_manager->find($id); if (null !== $project) { - $project->setApkStatus(Program::APK_NONE); + $project->setApkStatus(Project::APK_NONE); $this->project_manager->save($project); $this->logger->error("Project apk for id: \"{$id}\" not found; Status reset"); } @@ -83,11 +83,11 @@ protected function getApkFile(string $id): File return $file; } - protected function findProject(string $id): Program + protected function findProject(string $id): Project { - /* @var $project Program|null */ + /* @var $project Project|null */ $project = $this->project_manager->find($id); - if (null === $project || !$project->isVisible() || Program::APK_READY != $project->getApkStatus()) { + if (null === $project || !$project->isVisible() || Project::APK_READY != $project->getApkStatus()) { $this->logger->warning('Project with ID: '.$id.' not found'); throw new NotFoundHttpException(); } diff --git a/src/Application/Controller/Comments/CommentsController.php b/src/Application/Controller/Comments/CommentsController.php index dd3b8e7dae..dc32eba0b2 100644 --- a/src/Application/Controller/Comments/CommentsController.php +++ b/src/Application/Controller/Comments/CommentsController.php @@ -98,7 +98,7 @@ public function postCommentAction(NotificationManager $notification_service, Pro $temp_comment->setUsername($user->getUserIdentifier()); $temp_comment->setUser($user); $temp_comment->setText($_POST['Message']); - $temp_comment->setProgram($project); + $temp_comment->setProject($project); $date_time_zone = new \DateTimeZone('UTC'); $temp_comment->setUploadDate(date_create('now', $date_time_zone)); $temp_comment->setIsReported(false); diff --git a/src/Application/Controller/Project/CodeStatisticsController.php b/src/Application/Controller/Project/CodeStatisticsController.php index a8576b4513..a6f63d5b50 100644 --- a/src/Application/Controller/Project/CodeStatisticsController.php +++ b/src/Application/Controller/Project/CodeStatisticsController.php @@ -2,7 +2,7 @@ namespace App\Application\Controller\Project; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Project\CatrobatCode\Parser\CatrobatCodeParser; use App\Project\CatrobatFile\ExtractedFileRepository; use App\Project\ProjectManager; @@ -24,7 +24,7 @@ public function view(string $id): Response // Todo: add more statistic // Todo: better display of statistics -> E.g. Dr.Scratch $parsed_project = null; - /** @var Program|null $project */ + /** @var Project|null $project */ $project = $this->project_manager->find($id); if (null !== $project) { $extracted_file = $this->extracted_file_repository->loadProjectExtractedFile($project); diff --git a/src/Application/Controller/Project/CodeViewController.php b/src/Application/Controller/Project/CodeViewController.php index 0a8bdb9b2c..7c42ccafc4 100644 --- a/src/Application/Controller/Project/CodeViewController.php +++ b/src/Application/Controller/Project/CodeViewController.php @@ -2,7 +2,7 @@ namespace App\Application\Controller\Project; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Project\CatrobatCode\Parser\CatrobatCodeParser; use App\Project\CatrobatFile\ExtractedFileRepository; use App\Project\ProjectManager; @@ -21,7 +21,7 @@ public function __construct(private readonly ProjectManager $project_manager, pr #[Route(path: '/project/{id}/code_view', name: 'code_view', methods: ['GET'])] public function view(string $id): Response { - /** @var Program|null $project */ + /** @var Project|null $project */ $project = $this->project_manager->findProjectIfVisibleToCurrentUser($id); if (null === $project) { $this->addFlash('snackbar', $this->translator->trans('snackbar.project_not_found', [], 'catroweb')); diff --git a/src/Application/Controller/Project/ProjectController.php b/src/Application/Controller/Project/ProjectController.php index 6a87d111a6..a52df2b4da 100644 --- a/src/Application/Controller/Project/ProjectController.php +++ b/src/Application/Controller/Project/ProjectController.php @@ -4,8 +4,8 @@ use App\Api\Services\Projects\ProjectsRequestValidator; use App\Application\Twig\TwigExtension; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\ProgramLike; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\ProjectLike; use App\DB\Entity\User\Notifications\LikeNotification; use App\DB\Entity\User\User; use App\DB\EntityRepository\Translation\ProjectCustomTranslationRepository; @@ -68,7 +68,7 @@ public function projectAction(Request $request, string $id): Response return $this->redirectToRoute('index'); } - if ($project->isScratchProgram()) { + if ($project->isScratchProject()) { $this->event_dispatcher->dispatch(new CheckScratchProjectEvent($project->getScratchId())); } $viewed = $request->getSession()->get('viewed', []); @@ -116,7 +116,7 @@ public function projectLikeAction(Request $request, string $id): Response { $type = $request->query->getInt('type'); $action = (string) $request->query->get('action'); - if (!ProgramLike::isValidType($type)) { + if (!ProjectLike::isValidType($type)) { if ($request->isXmlHttpRequest()) { return new JsonResponse([ 'statusCode' => Response::HTTP_UNPROCESSABLE_ENTITY, @@ -169,12 +169,12 @@ public function projectLikeAction(Request $request, string $id): Response $project, $project->getUser(), $user ); - if (ProgramLike::ACTION_ADD === $action) { + if (ProjectLike::ACTION_ADD === $action) { if (0 === count($existing_notifications)) { $notification = new LikeNotification($project->getUser(), $user, $project); $this->notification_service->addNotification($notification); } - } elseif (ProgramLike::ACTION_REMOVE === $action) { + } elseif (ProjectLike::ACTION_REMOVE === $action) { // check if there is no other reaction if (!$this->project_manager->areThereOtherLikeTypes($project, $user, $type)) { foreach ($existing_notifications as $notification) { @@ -188,7 +188,7 @@ public function projectLikeAction(Request $request, string $id): Response } $user_locale = $request->getLocale(); $total_like_count = $this->project_manager->totalLikeCount($project->getId()); - $active_like_types = array_map(fn ($type_id) => ProgramLike::$TYPE_NAMES[$type_id], $this->project_manager->findProjectLikeTypes($project->getId())); + $active_like_types = array_map(fn ($type_id) => ProjectLike::$TYPE_NAMES[$type_id], $this->project_manager->findProjectLikeTypes($project->getId())); return new JsonResponse([ 'totalLikeCount' => [ @@ -402,7 +402,7 @@ public function projectCustomTranslationLanguageListAction(string $id, ProjectCu public function projectCommentDetail(string $id): Response { $arr_comment = $this->comment_repository->getProjectCommentDetailViewData($id); - $project = $this->project_manager->findProjectIfVisibleToCurrentUser($arr_comment['program_id'] ?? null); + $project = $this->project_manager->findProjectIfVisibleToCurrentUser($arr_comment['project_id'] ?? null); if (null === $project) { return $this->redirectToIndexOnError(); } @@ -425,7 +425,7 @@ protected function redirectToIndexOnError(): RedirectResponse return $this->redirectToRoute('index'); } - private function checkAndAddViewed(Request $request, Program $project, array $viewed): void + private function checkAndAddViewed(Request $request, Project $project, array $viewed): void { if (!in_array($project->getId(), $viewed, true)) { $this->project_manager->increaseViews($project); @@ -434,7 +434,7 @@ private function checkAndAddViewed(Request $request, Program $project, array $vi } } - private function createProjectDetailsArray(Program $project, + private function createProjectDetailsArray(Project $project, array $active_like_types, array $active_user_like_types, int $total_like_count, diff --git a/src/Application/Controller/User/NotificationsController.php b/src/Application/Controller/User/NotificationsController.php index 0e2d2755c2..d40c39edf1 100644 --- a/src/Application/Controller/User/NotificationsController.php +++ b/src/Application/Controller/User/NotificationsController.php @@ -5,7 +5,7 @@ use App\DB\Entity\User\Notifications\CommentNotification; use App\DB\Entity\User\Notifications\FollowNotification; use App\DB\Entity\User\Notifications\LikeNotification; -use App\DB\Entity\User\Notifications\NewProgramNotification; +use App\DB\Entity\User\Notifications\NewProjectNotification; use App\DB\Entity\User\Notifications\RemixNotification; use App\DB\Entity\User\User; use App\DB\EntityRepository\User\Notification\NotificationRepository; @@ -51,22 +51,22 @@ public function NotificationsAction(NotificationRepository $notification_reposit $all_notifications[$notification->getId()] = $notification; $reaction_notifications[$notification->getId()] = $notification; $notification_instance[$notification->getId()] = 'reaction'; - $redirect_array[$notification->getId()] = $notification->getProgram()->getId(); + $redirect_array[$notification->getId()] = $notification->getProject()->getId(); } } elseif ($notification instanceof CommentNotification) { if ($notification->getComment()->getUser() != $this->getUser()) { $all_notifications[$notification->getId()] = $notification; $comment_notifications[$notification->getId()] = $notification; $notification_instance[$notification->getId()] = 'comment'; - $redirect_array[$notification->getId()] = $notification->getComment()->getProgram()->getId(); + $redirect_array[$notification->getId()] = $notification->getComment()->getProject()->getId(); } - } elseif ($notification instanceof NewProgramNotification) { - $user = $notification->getProgram()->getUser(); + } elseif ($notification instanceof NewProjectNotification) { + $user = $notification->getProject()->getUser(); if ($user != $this->getUser()) { $all_notifications[$notification->getId()] = $notification; $follower_notifications[$notification->getId()] = $notification; $notification_instance[$notification->getId()] = 'program'; - $redirect_array[$notification->getId()] = $notification->getProgram()->getId(); + $redirect_array[$notification->getId()] = $notification->getProject()->getId(); } } elseif ($notification instanceof FollowNotification) { $user = $notification->getFollower(); @@ -82,7 +82,7 @@ public function NotificationsAction(NotificationRepository $notification_reposit $all_notifications[$notification->getId()] = $notification; $remix_notifications[$notification->getId()] = $notification; $notification_instance[$notification->getId()] = 'remix'; - $redirect_array[$notification->getId()] = $notification->getRemixProgram()->getId(); + $redirect_array[$notification->getId()] = $notification->getRemixProject()->getId(); } } else { $all_notifications[$notification->getId()] = $notification; @@ -162,8 +162,8 @@ public function fetchMoreNotifications(NotificationRepository $notification_repo $fetched_notifications[] = ['id' => $notification->getId(), 'from' => $notification->getLikeFrom()->getId(), 'from_name' => $notification->getLikeFrom()->getUserIdentifier(), - 'program' => $notification->getProgram()->getId(), - 'program_name' => $notification->getProgram()->getName(), + 'program' => $notification->getProject()->getId(), + 'program_name' => $notification->getProject()->getName(), 'avatar' => $notification->getLikeFrom()->getAvatar(), 'remixed_program' => null, 'remixed_program_name' => null, @@ -173,10 +173,10 @@ public function fetchMoreNotifications(NotificationRepository $notification_repo continue; } - if (($notification instanceof FollowNotification || $notification instanceof NewProgramNotification) + if (($notification instanceof FollowNotification || $notification instanceof NewProjectNotification) && ('follow' === $type || 'all' === $type)) { if (($notification instanceof FollowNotification && $notification->getFollower() === $this->getUser()) - || ($notification instanceof NewProgramNotification && $notification->getProgram()->getUser() === $this->getUser())) { + || ($notification instanceof NewProjectNotification && $notification->getProject()->getUser() === $this->getUser())) { continue; } if ($notification instanceof FollowNotification) { @@ -193,11 +193,11 @@ public function fetchMoreNotifications(NotificationRepository $notification_repo 'seen' => $notification->getSeen(), ]; } else { $fetched_notifications[] = ['id' => $notification->getId(), - 'from' => $notification->getProgram()->getUser()->getId(), - 'from_name' => $notification->getProgram()->getUser()->getUserIdentifier(), - 'program' => $notification->getProgram()->getId(), - 'program_name' => $notification->getProgram()->getName(), - 'avatar' => $notification->getProgram()->getUser()->getAvatar(), + 'from' => $notification->getProject()->getUser()->getId(), + 'from_name' => $notification->getProject()->getUser()->getUserIdentifier(), + 'program' => $notification->getProject()->getId(), + 'program_name' => $notification->getProject()->getName(), + 'avatar' => $notification->getProject()->getUser()->getAvatar(), 'remixed_program' => null, 'remixed_program_name' => null, 'type' => 'program', @@ -213,8 +213,8 @@ public function fetchMoreNotifications(NotificationRepository $notification_repo $fetched_notifications[] = ['id' => $notification->getId(), 'from' => $notification->getComment()->getUser()->getId(), 'from_name' => $notification->getComment()->getUser()->getUserIdentifier(), - 'program' => $notification->getComment()->getProgram()->getId(), - 'program_name' => $notification->getComment()->getProgram()->getName(), + 'program' => $notification->getComment()->getProject()->getId(), + 'program_name' => $notification->getComment()->getProject()->getName(), 'avatar' => $notification->getComment()->getUser()->getAvatar(), 'remixed_program' => null, 'remixed_program_name' => null, @@ -231,11 +231,11 @@ public function fetchMoreNotifications(NotificationRepository $notification_repo $fetched_notifications[] = ['id' => $notification->getId(), 'from' => $notification->getRemixFrom()->getId(), 'from_name' => $notification->getRemixFrom()->getUserIdentifier(), - 'program' => $notification->getRemixProgram()->getId(), - 'program_name' => $notification->getRemixProgram()->getName(), + 'program' => $notification->getRemixProject()->getId(), + 'program_name' => $notification->getRemixProject()->getName(), 'avatar' => $notification->getRemixFrom()->getAvatar(), - 'remixed_program' => $notification->getProgram()->getId(), - 'remixed_program_name' => $notification->getProgram()->getName(), + 'remixed_program' => $notification->getProject()->getId(), + 'remixed_program_name' => $notification->getProject()->getName(), 'type' => 'remix', 'message' => $translator->trans('catro-notifications.remix.message', [], 'catroweb'), 'seen' => $notification->getSeen(), ]; diff --git a/src/DB/Entity/Project/Extension.php b/src/DB/Entity/Project/Extension.php index 6bcc7d351b..096e869a4a 100644 --- a/src/DB/Entity/Project/Extension.php +++ b/src/DB/Entity/Project/Extension.php @@ -41,9 +41,9 @@ class Extension implements \Stringable protected ?int $id = null; /** - * @ORM\ManyToMany(targetEntity=Program::class, mappedBy="extensions") + * @ORM\ManyToMany(targetEntity=Project::class, mappedBy="extensions") */ - protected Collection $programs; + protected Collection $projects; /** * @ORM\Column(name="internal_title", type="string", nullable=false) @@ -62,7 +62,7 @@ class Extension implements \Stringable public function __construct() { - $this->programs = new ArrayCollection(); + $this->projects = new ArrayCollection(); } public function __toString(): string @@ -111,31 +111,31 @@ public function setEnabled(bool $enabled): Extension return $this; } - public function addProgram(Program $program): void + public function addProject(Project $project): void { - if ($this->programs->contains($program)) { + if ($this->projects->contains($project)) { return; } - $this->programs->add($program); + $this->projects->add($project); } - public function removeProgram(Program $program): void + public function removeProject(Project $project): void { - $this->programs->removeElement($program); + $this->projects->removeElement($project); } - public function getPrograms(): Collection + public function getProjects(): Collection { - return $this->programs; + return $this->projects; } public function getProjectCount(): int { - return count($this->programs); + return count($this->projects); } - public function removeAllPrograms(): void + public function removeAllProjects(): void { - $this->programs->clear(); + $this->projects->clear(); } } diff --git a/src/DB/Entity/Project/Program.php b/src/DB/Entity/Project/Project.php similarity index 80% rename from src/DB/Entity/Project/Program.php rename to src/DB/Entity/Project/Project.php index f836d38eb9..646b55c12d 100644 --- a/src/DB/Entity/Project/Program.php +++ b/src/DB/Entity/Project/Project.php @@ -2,16 +2,16 @@ namespace App\DB\Entity\Project; -use App\DB\Entity\Project\Remix\ProgramRemixBackwardRelation; -use App\DB\Entity\Project\Remix\ProgramRemixRelation; -use App\DB\Entity\Project\Scratch\ScratchProgramRemixRelation; +use App\DB\Entity\Project\Remix\ProjectRemixBackwardRelation; +use App\DB\Entity\Project\Remix\ProjectRemixRelation; +use App\DB\Entity\Project\Scratch\ScratchProjectRemixRelation; use App\DB\Entity\Translation\ProjectCustomTranslation; use App\DB\Entity\User\Comment\UserComment; use App\DB\Entity\User\Notifications\LikeNotification; -use App\DB\Entity\User\Notifications\NewProgramNotification; +use App\DB\Entity\User\Notifications\NewProjectNotification; use App\DB\Entity\User\Notifications\RemixNotification; use App\DB\Entity\User\User; -use App\DB\EntityRepository\Project\ProgramRepository; +use App\DB\EntityRepository\Project\ProjectRepository; use App\DB\Generator\MyUuidGenerator; use App\Utils\TimeUtils; use DateTime; @@ -23,7 +23,7 @@ * @ORM\HasLifecycleCallbacks * * @ORM\Table( - * name="program", + * name="project", * indexes={ * * @ORM\Index(name="rand_idx", columns={"rand"}), @@ -40,9 +40,9 @@ * } * ) * - * @ORM\Entity(repositoryClass=ProgramRepository::class) + * @ORM\Entity(repositoryClass=ProjectRepository::class) */ -class Program implements \Stringable +class Project implements \Stringable { final public const APK_NONE = 0; @@ -89,11 +89,11 @@ class Program implements \Stringable protected ?int $scratch_id = null; /** - * The user owning this Program. If this User gets deleted, this Program gets deleted as well. + * The user owning this Project. If this User gets deleted, this Project gets deleted as well. * * @ORM\ManyToOne( * targetEntity=User::class, - * inversedBy="programs" + * inversedBy="projects" * ) * * @ORM\JoinColumn( @@ -105,11 +105,11 @@ class Program implements \Stringable protected ?User $user = null; /** - * The UserComments commenting this Program. If this Program gets deleted, these UserComments get deleted as well. + * The UserComments commenting this Project. If this Project gets deleted, these UserComments get deleted as well. * * @ORM\OneToMany( * targetEntity=UserComment::class, - * mappedBy="program", + * mappedBy="project", * fetch="EXTRA_LAZY", * cascade={"remove"} * ) @@ -117,12 +117,12 @@ class Program implements \Stringable protected Collection $comments; /** - * The LikeNotifications mentioning this Program. If this Program gets deleted, + * The LikeNotifications mentioning this Project. If this Project gets deleted, * these LikeNotifications get deleted as well. * * @ORM\OneToMany( * targetEntity=LikeNotification::class, - * mappedBy="program", + * mappedBy="project", * fetch="EXTRA_LAZY", * cascade={"remove"} * ) @@ -130,25 +130,25 @@ class Program implements \Stringable protected Collection $like_notification_mentions; /** - * The NewProgramNotification mentioning this Program as a new Program. - * If this Program gets deleted, these NewProgramNotifications get deleted as well. + * The NewProjectNotification mentioning this Project as a new Project. + * If this Project gets deleted, these NewProjectNotifications get deleted as well. * * @ORM\OneToMany( - * targetEntity=NewProgramNotification::class, - * mappedBy="program", + * targetEntity=NewProjectNotification::class, + * mappedBy="project", * fetch="EXTRA_LAZY", * cascade={"remove"} * ) */ - protected Collection $new_program_notification_mentions; + protected Collection $new_project_notification_mentions; /** - * RemixNotifications which are triggered when this Program (child) is created as a remix of - * another one (parent). If this Program gets deleted, all those RemixNotifications get deleted as well. + * RemixNotifications which are triggered when this Project (child) is created as a remix of + * another one (parent). If this Project gets deleted, all those RemixNotifications get deleted as well. * * @ORM\OneToMany( * targetEntity=RemixNotification::class, - * mappedBy="remix_program", + * mappedBy="remix_project", * fetch="EXTRA_LAZY", * cascade={"remove"} * ) @@ -156,12 +156,12 @@ class Program implements \Stringable protected Collection $remix_notification_mentions_as_child; /** - * RemixNotifications mentioning this Program as a parent Program of a new remix Program (child). - * If this Program gets deleted, all RemixNotifications mentioning this program get deleted as well. + * RemixNotifications mentioning this Project as a parent Project of a new remix Project (child). + * If this Project gets deleted, all RemixNotifications mentioning this project get deleted as well. * * @ORM\OneToMany( * targetEntity=RemixNotification::class, - * mappedBy="program", + * mappedBy="project", * fetch="EXTRA_LAZY", * cascade={"remove"} * ) @@ -169,13 +169,13 @@ class Program implements \Stringable protected Collection $remix_notification_mentions_as_parent; /** - * @ORM\ManyToMany(targetEntity=Tag::class, inversedBy="programs") + * @ORM\ManyToMany(targetEntity=Tag::class, inversedBy="projects") * * @ORM\JoinTable( - * name="program_tag", + * name="project_tag", * joinColumns={ * - * @ORM\JoinColumn(name="program_id", referencedColumnName="id") + * @ORM\JoinColumn(name="project_id", referencedColumnName="id") * }, * inverseJoinColumns={ * @ORM\JoinColumn(name="tag_id", referencedColumnName="id") @@ -185,13 +185,13 @@ class Program implements \Stringable protected Collection $tags; /** - * @ORM\ManyToMany(targetEntity=Extension::class, inversedBy="programs") + * @ORM\ManyToMany(targetEntity=Extension::class, inversedBy="projects") * * @ORM\JoinTable( - * name="program_extension", + * name="project_extension", * joinColumns={ * - * @ORM\JoinColumn(name="program_id", referencedColumnName="id") + * @ORM\JoinColumn(name="project_id", referencedColumnName="id") * }, * inverseJoinColumns={ * @ORM\JoinColumn(name="extension_id", referencedColumnName="id") @@ -274,7 +274,7 @@ class Program implements \Stringable /** * @ORM\OneToMany( - * targetEntity=ProgramRemixRelation::class, + * targetEntity=ProjectRemixRelation::class, * mappedBy="descendant", * cascade={"persist", "remove"}, * orphanRemoval=true @@ -284,7 +284,7 @@ class Program implements \Stringable /** * @ORM\OneToMany( - * targetEntity=ProgramRemixBackwardRelation::class, + * targetEntity=ProjectRemixBackwardRelation::class, * mappedBy="child", * cascade={"persist", "remove"}, * orphanRemoval=true @@ -294,7 +294,7 @@ class Program implements \Stringable /** * @ORM\OneToMany( - * targetEntity=ProgramRemixRelation::class, + * targetEntity=ProjectRemixRelation::class, * mappedBy="ancestor", * cascade={"persist", "remove"}, * orphanRemoval=true @@ -304,7 +304,7 @@ class Program implements \Stringable /** * @ORM\OneToMany( - * targetEntity=ProgramRemixBackwardRelation::class, + * targetEntity=ProjectRemixBackwardRelation::class, * mappedBy="parent", * cascade={"persist", "remove"}, * orphanRemoval=true @@ -314,7 +314,7 @@ class Program implements \Stringable /** * @ORM\OneToMany( - * targetEntity=ScratchProgramRemixRelation::class, + * targetEntity=ScratchProjectRemixRelation::class, * mappedBy="catrobat_child", * cascade={"persist", "remove"}, * orphanRemoval=true @@ -324,8 +324,8 @@ class Program implements \Stringable /** * @ORM\OneToMany( - * targetEntity=ProgramLike::class, - * mappedBy="program", + * targetEntity=ProjectLike::class, + * mappedBy="project", * cascade={"persist", "remove"}, * orphanRemoval=true * ) @@ -365,7 +365,7 @@ class Program implements \Stringable protected bool $debug_build = false; /** - * @ORM\OneToMany(targetEntity=ProgramInappropriateReport::class, mappedBy="program", fetch="EXTRA_LAZY") + * @ORM\OneToMany(targetEntity=ProjectInappropriateReport::class, mappedBy="project", fetch="EXTRA_LAZY") */ protected Collection $reports; @@ -393,7 +393,7 @@ public function __construct() { $this->comments = new ArrayCollection(); $this->like_notification_mentions = new ArrayCollection(); - $this->new_program_notification_mentions = new ArrayCollection(); + $this->new_project_notification_mentions = new ArrayCollection(); $this->remix_notification_mentions_as_child = new ArrayCollection(); $this->remix_notification_mentions_as_parent = new ArrayCollection(); $this->tags = new ArrayCollection(); @@ -464,7 +464,7 @@ public function getId(): ?string return $this->id; } - public function setName(string $name): Program + public function setName(string $name): Project { $this->name = $name; $this->should_invalidate_translation_cache = true; @@ -477,7 +477,7 @@ public function getName(): string return $this->name; } - public function setDescription(?string $description): Program + public function setDescription(?string $description): Project { $this->description = $description; $this->should_invalidate_translation_cache = true; @@ -490,7 +490,7 @@ public function getDescription(): ?string return $this->description; } - public function setCredits(?string $credits): Program + public function setCredits(?string $credits): Project { $this->credits = $credits; $this->should_invalidate_translation_cache = true; @@ -503,7 +503,7 @@ public function getCredits(): ?string return $this->credits; } - public function setViews(int $views): Program + public function setViews(int $views): Project { $this->views = $views; @@ -515,14 +515,14 @@ public function getViews(): int return $this->views; } - public function setVersion(int $version): Program + public function setVersion(int $version): Project { $this->version = $version; return $this; } - public function incrementVersion(): Program + public function incrementVersion(): Project { ++$this->version; @@ -534,7 +534,7 @@ public function getVersion(): int return $this->version; } - public function setDownloads(int $downloads): Program + public function setDownloads(int $downloads): Project { $this->downloads = $downloads; @@ -546,7 +546,7 @@ public function getDownloads(): int return $this->downloads; } - public function setUploadedAt(\DateTime $uploadedAt): Program + public function setUploadedAt(\DateTime $uploadedAt): Project { $this->uploaded_at = $uploadedAt; @@ -558,7 +558,7 @@ public function getUploadedAt(): \DateTime return $this->uploaded_at; } - public function setLastModifiedAt(\DateTime $lastModifiedAt): Program + public function setLastModifiedAt(\DateTime $lastModifiedAt): Project { $this->last_modified_at = $lastModifiedAt; @@ -570,7 +570,7 @@ public function getLastModifiedAt(): \DateTime return $this->last_modified_at; } - public function setRemixMigratedAt(?\DateTime $remix_migrated_at): Program + public function setRemixMigratedAt(?\DateTime $remix_migrated_at): Project { $this->remix_migrated_at = $remix_migrated_at; @@ -583,9 +583,9 @@ public function getRemixMigratedAt(): ?\DateTime } /** - * Sets the user owning this Program. + * Sets the user owning this Project. */ - public function setUser(User $user = null): Program + public function setUser(User $user = null): Project { $this->user = $user; @@ -593,7 +593,7 @@ public function setUser(User $user = null): Program } /** - * Returns the user owning this Program. + * Returns the user owning this Project. */ public function getUser(): ?User { @@ -615,7 +615,7 @@ public function setComments(Collection $comments): void $this->comments = $comments; } - public function setLanguageVersion(string $languageVersion): Program + public function setLanguageVersion(string $languageVersion): Project { $this->language_version = $languageVersion; @@ -627,7 +627,7 @@ public function getLanguageVersion(): string return $this->language_version; } - public function setCatrobatVersionName(string $catrobat_version_name): Program + public function setCatrobatVersionName(string $catrobat_version_name): Project { $this->catrobat_version_name = $catrobat_version_name; @@ -639,7 +639,7 @@ public function getCatrobatVersionName(): string return $this->catrobat_version_name; } - public function setUploadIp(string $uploadIp): Program + public function setUploadIp(string $uploadIp): Project { $this->upload_ip = $uploadIp; @@ -651,14 +651,14 @@ public function getUploadIp(): string return $this->upload_ip; } - public function setVisible(bool $visible): Program + public function setVisible(bool $visible): Project { $this->visible = $visible; return $this; } - public function setPrivate(bool $private): Program + public function setPrivate(bool $private): Project { $this->private = $private; @@ -675,7 +675,7 @@ public function getVisible(): bool return $this->visible; } - public function setUploadLanguage(string $uploadLanguage): Program + public function setUploadLanguage(string $uploadLanguage): Project { $this->upload_language = $uploadLanguage; @@ -687,7 +687,7 @@ public function getUploadLanguage(): string return $this->upload_language; } - public function setFilesize(int $filesize): Program + public function setFilesize(int $filesize): Project { $this->filesize = $filesize; @@ -734,14 +734,14 @@ public function getApkStatus(): int return $this->apk_status; } - public function setApkStatus(int $apk_status): Program + public function setApkStatus(int $apk_status): Project { $this->apk_status = $apk_status; return $this; } - public function setApkRequestTime(?\DateTime $apkRequestTime): Program + public function setApkRequestTime(?\DateTime $apkRequestTime): Project { $this->apk_request_time = $apkRequestTime; @@ -753,7 +753,7 @@ public function getApkRequestTime(): ?\DateTime return $this->apk_request_time; } - public function setApkDownloads(int $apkDownloads): Program + public function setApkDownloads(int $apkDownloads): Project { $this->apk_downloads = $apkDownloads; @@ -827,7 +827,7 @@ public function getCatrobatRemixDescendantIds(): array { $relations = $this->getCatrobatRemixDescendantRelations()->getValues(); - return array_unique(array_map(fn (ProgramRemixRelation $ra) => $ra->getDescendantId(), $relations)); + return array_unique(array_map(fn (ProjectRemixRelation $ra) => $ra->getDescendantId(), $relations)); } public function getScratchRemixParentRelations(): Collection @@ -858,9 +858,9 @@ public function getExtensions(): Collection public function getExtensionsString(): string { $extensions = []; - foreach ($this->extensions as $program_extension) { - /* @var Extension $program_extension */ - $extensions[] = $program_extension->getInternalTitle(); + foreach ($this->extensions as $project_extension) { + /* @var Extension $project_extension */ + $extensions[] = $project_extension->getInternalTitle(); } return implode(', ', $extensions); @@ -869,9 +869,9 @@ public function getExtensionsString(): string public function getTagsString(): string { $tags = []; - foreach ($this->tags as $program_tag) { - /* @var Tag $program_tag */ - $tags[] = $program_tag->getInternalTitle(); + foreach ($this->tags as $project_tag) { + /* @var Tag $project_tag */ + $tags[] = $project_tag->getInternalTitle(); } return implode(', ', $tags); @@ -888,7 +888,7 @@ public function setDebugBuild(bool $debug_build): void } /** - * Returns the LikeNotifications mentioning this Program. + * Returns the LikeNotifications mentioning this Project. */ public function getLikeNotificationMentions(): Collection { @@ -896,7 +896,7 @@ public function getLikeNotificationMentions(): Collection } /** - * Sets the LikeNotifications mentioning this Program. + * Sets the LikeNotifications mentioning this Project. */ public function setLikeNotificationMentions(Collection $like_notification_mentions): void { @@ -904,19 +904,19 @@ public function setLikeNotificationMentions(Collection $like_notification_mentio } /** - * Returns the NewProgramNotification mentioning this Program as a new Program. + * Returns the NewProjectNotification mentioning this Project as a new Project. */ - public function getNewProgramNotificationMentions(): Collection + public function getNewProjectNotificationMentions(): Collection { - return $this->new_program_notification_mentions; + return $this->new_project_notification_mentions; } /** - * Sets the NewProgramNotifications mentioning this Program as a new Program. + * Sets the NewProjectNotifications mentioning this Project as a new Project. */ - public function setNewProgramNotificationMentions(Collection $new_program_notification_mentions): void + public function setNewProjectNotificationMentions(Collection $new_project_notification_mentions): void { - $this->new_program_notification_mentions = $new_program_notification_mentions; + $this->new_project_notification_mentions = $new_project_notification_mentions; } public function getReports(): Collection @@ -930,7 +930,7 @@ public function getReportsCount(): int } /** - * Returns the RemixNotifications which are triggered when this Program (child) is created as a remix of + * Returns the RemixNotifications which are triggered when this Project (child) is created as a remix of * another one (parent). */ public function getRemixNotificationMentionsAsChild(): Collection @@ -939,7 +939,7 @@ public function getRemixNotificationMentionsAsChild(): Collection } /** - * Sets theRemixNotifications which are triggered when this Program (child) is created as a remix of + * Sets theRemixNotifications which are triggered when this Project (child) is created as a remix of * another one (parent). */ public function setRemixNotificationMentionsAsChild(Collection $remix_notification_mentions_as_child): void @@ -948,7 +948,7 @@ public function setRemixNotificationMentionsAsChild(Collection $remix_notificati } /** - * Returns the RemixNotifications mentioning this Program as a parent Program of a new remix Program (child). + * Returns the RemixNotifications mentioning this Project as a parent Project of a new remix Project (child). */ public function getRemixNotificationMentionsAsParent(): Collection { @@ -956,7 +956,7 @@ public function getRemixNotificationMentionsAsParent(): Collection } /** - * Sets the RemixNotifications mentioning this Program as a parent Program of a new remix Program (child). + * Sets the RemixNotifications mentioning this Project as a parent Project of a new remix Project (child). */ public function setRemixNotificationMentionsAsParent(Collection $remix_notification_mentions_as_parent): void { @@ -973,7 +973,7 @@ public function getImageType(): string return ''; } - public function getProgram(): ?Program + public function getProject(): ?Project { return $this; } @@ -988,7 +988,7 @@ public function getScratchId(): ?int return $this->scratch_id; } - public function isScratchProgram(): bool + public function isScratchProject(): bool { return null !== $this->scratch_id; } @@ -1003,7 +1003,7 @@ public function getRand(): int return $this->rand; } - public function setRand(int $rand): Program + public function setRand(int $rand): Project { $this->rand = $rand; @@ -1020,7 +1020,7 @@ public function getPopularity(): float return $this->popularity; } - public function setPopularity(float $popularity): Program + public function setPopularity(float $popularity): Project { $this->popularity = $popularity; diff --git a/src/DB/Entity/Project/ProgramDownloads.php b/src/DB/Entity/Project/ProjectDownloads.php similarity index 71% rename from src/DB/Entity/Project/ProgramDownloads.php rename to src/DB/Entity/Project/ProjectDownloads.php index 01b8ae911a..86e84081b8 100644 --- a/src/DB/Entity/Project/ProgramDownloads.php +++ b/src/DB/Entity/Project/ProjectDownloads.php @@ -9,9 +9,9 @@ /** * @ORM\Entity * - * @ORM\Table(name="program_downloads") + * @ORM\Table(name="project_downloads") */ -class ProgramDownloads +class ProjectDownloads { final public const TYPE_PROJECT = 'project'; final public const TYPE_APK = 'apk'; @@ -26,11 +26,11 @@ class ProgramDownloads protected ?int $id = null; /** - * @ORM\ManyToOne(targetEntity=Program::class, inversedBy="program_downloads") + * @ORM\ManyToOne(targetEntity=Project::class, inversedBy="project_downloads") * - * @ORM\JoinColumn(name="program_id", referencedColumnName="id", nullable=true, onDelete="SET NULL") + * @ORM\JoinColumn(name="project_id", referencedColumnName="id", nullable=true, onDelete="SET NULL") */ - protected Program $program; + protected Project $project; /** * @ORM\ManyToOne(targetEntity=User::class) @@ -54,21 +54,21 @@ public function getId(): ?int return $this->id; } - public function setId(int $id): ProgramDownloads + public function setId(int $id): ProjectDownloads { $this->id = $id; return $this; } - public function getProgram(): Program + public function getProject(): Project { - return $this->program; + return $this->project; } - public function setProgram(Program $program): ProgramDownloads + public function setProject(Project $project): ProjectDownloads { - $this->program = $program; + $this->project = $project; return $this; } @@ -78,7 +78,7 @@ public function getUser(): ?User return $this->user; } - public function setUser(?User $user): ProgramDownloads + public function setUser(?User $user): ProjectDownloads { $this->user = $user; @@ -90,7 +90,7 @@ public function getDownloadedAt(): ?\DateTime return $this->downloaded_at; } - public function setDownloadedAt(?\DateTime $downloaded_at): ProgramDownloads + public function setDownloadedAt(?\DateTime $downloaded_at): ProjectDownloads { $this->downloaded_at = $downloaded_at; @@ -102,7 +102,7 @@ public function getType(): ?string return $this->type; } - public function setType(?string $type): ProgramDownloads + public function setType(?string $type): ProjectDownloads { $this->type = $type; diff --git a/src/DB/Entity/Project/ProgramInappropriateReport.php b/src/DB/Entity/Project/ProjectInappropriateReport.php similarity index 74% rename from src/DB/Entity/Project/ProgramInappropriateReport.php rename to src/DB/Entity/Project/ProjectInappropriateReport.php index 0ef56fda35..f98a0ca762 100644 --- a/src/DB/Entity/Project/ProgramInappropriateReport.php +++ b/src/DB/Entity/Project/ProjectInappropriateReport.php @@ -3,21 +3,21 @@ namespace App\DB\Entity\Project; use App\DB\Entity\User\User; -use App\DB\EntityRepository\Project\ProgramInappropriateReportRepository; +use App\DB\EntityRepository\Project\ProjectInappropriateReportRepository; use App\Utils\TimeUtils; use DateTime; use Doctrine\ORM\Mapping as ORM; /** - * ProgramInappropriateReport. + * ProjectInappropriateReport. * * @ORM\HasLifecycleCallbacks * * @ORM\Table * - * @ORM\Entity(repositoryClass=ProgramInappropriateReportRepository::class) + * @ORM\Entity(repositoryClass=ProjectInappropriateReportRepository::class) */ -class ProgramInappropriateReport +class ProjectInappropriateReport { final public const STATUS_NEW = 1; final public const STATUS_REJECTED = 2; @@ -67,11 +67,11 @@ class ProgramInappropriateReport private ?int $state = null; /** - * @ORM\ManyToOne(targetEntity=Program::class, inversedBy="reports") + * @ORM\ManyToOne(targetEntity=Project::class, inversedBy="reports") * - * @ORM\JoinColumn(name="program_id", referencedColumnName="id", onDelete="SET NULL") + * @ORM\JoinColumn(name="project_id", referencedColumnName="id", onDelete="SET NULL") */ - private ?Program $program = null; + private ?Project $project = null; /** * @ORM\Column(name="projectVersion", type="integer") @@ -103,9 +103,9 @@ public function updateState(): void /** * @ORM\PrePersist */ - public function updateProgramVersion(): void + public function updateProjectVersion(): void { - $this->setProjectVersion($this->getProgram()->getVersion()); + $this->setProjectVersion($this->getProject()->getVersion()); } public function getId(): ?int @@ -113,7 +113,7 @@ public function getId(): ?int return $this->id; } - public function setReportingUser(?User $reporting_user): ProgramInappropriateReport + public function setReportingUser(?User $reporting_user): ProjectInappropriateReport { $this->reporting_user = $reporting_user; @@ -125,7 +125,7 @@ public function getReportingUser(): ?User return $this->reporting_user; } - public function setReportedUser(?User $reported_user): ProgramInappropriateReport + public function setReportedUser(?User $reported_user): ProjectInappropriateReport { $this->reported_user = $reported_user; @@ -137,7 +137,7 @@ public function getReportedUser(): ?User return $this->reported_user; } - public function setCategory(string $category): ProgramInappropriateReport + public function setCategory(string $category): ProjectInappropriateReport { $this->category = $category; @@ -149,7 +149,7 @@ public function getCategory(): ?string return $this->category; } - public function setNote(string $note): ProgramInappropriateReport + public function setNote(string $note): ProjectInappropriateReport { $this->note = $note; @@ -161,7 +161,7 @@ public function getNote(): ?string return $this->note; } - public function setTime(\DateTime $time): ProgramInappropriateReport + public function setTime(\DateTime $time): ProjectInappropriateReport { $this->time = $time; @@ -176,7 +176,7 @@ public function getTime(): ?\DateTime /** * @throws \InvalidArgumentException */ - public function setState(int $state): ProgramInappropriateReport + public function setState(int $state): ProjectInappropriateReport { if (!in_array($state, [self::STATUS_NEW, self::STATUS_ACCEPTED, self::STATUS_REJECTED], true)) { throw new \InvalidArgumentException('Invalid state'); @@ -191,19 +191,19 @@ public function getState(): ?int return $this->state; } - public function setProgram(?Program $program): ProgramInappropriateReport + public function setProject(?Project $project): ProjectInappropriateReport { - $this->program = $program; + $this->project = $project; return $this; } - public function getProgram(): ?Program + public function getProject(): ?Project { - return $this->program; + return $this->project; } - public function setProjectVersion(int $projectVersion): ProgramInappropriateReport + public function setProjectVersion(int $projectVersion): ProjectInappropriateReport { $this->projectVersion = $projectVersion; diff --git a/src/DB/Entity/Project/ProgramLike.php b/src/DB/Entity/Project/ProjectLike.php similarity index 76% rename from src/DB/Entity/Project/ProgramLike.php rename to src/DB/Entity/Project/ProjectLike.php index 73c15798e0..3e9694d078 100644 --- a/src/DB/Entity/Project/ProgramLike.php +++ b/src/DB/Entity/Project/ProjectLike.php @@ -3,7 +3,7 @@ namespace App\DB\Entity\Project; use App\DB\Entity\User\User; -use App\DB\EntityRepository\Project\ProgramLikeRepository; +use App\DB\EntityRepository\Project\ProjectLikeRepository; use App\Utils\TimeUtils; use DateTime; use Doctrine\ORM\Mapping as ORM; @@ -11,11 +11,11 @@ /** * @ORM\HasLifecycleCallbacks * - * @ORM\Table(name="program_like") + * @ORM\Table(name="project_like") * - * @ORM\Entity(repositoryClass=ProgramLikeRepository::class) + * @ORM\Entity(repositoryClass=ProjectLikeRepository::class) */ -class ProgramLike implements \Stringable +class ProjectLike implements \Stringable { final public const TYPE_NONE = 0; final public const TYPE_THUMBS_UP = 1; @@ -56,14 +56,14 @@ class ProgramLike implements \Stringable * * @ORM\Column(type="guid", nullable=false) */ - protected string $program_id; + protected string $project_id; /** - * @ORM\ManyToOne(targetEntity=Program::class, inversedBy="likes", fetch="LAZY") + * @ORM\ManyToOne(targetEntity=Project::class, inversedBy="likes", fetch="LAZY") * - * @ORM\JoinColumn(name="program_id", referencedColumnName="id") + * @ORM\JoinColumn(name="project_id", referencedColumnName="id") */ - protected Program $program; + protected Project $project; /** * @ORM\Id @@ -91,16 +91,16 @@ class ProgramLike implements \Stringable */ protected ?\DateTime $created_at = null; - public function __construct(Program $program, User $user, int $type) + public function __construct(Project $project, User $user, int $type) { - $this->setProgram($program); + $this->setProject($project); $this->setUser($user); $this->setType($type); } public function __toString(): string { - return $this->program.''; + return $this->project.''; } public static function isValidType(int $type): bool @@ -120,25 +120,25 @@ public function updateTimestamps(): void } } - public function setProgram(Program $program): ProgramLike + public function setProject(Project $project): ProjectLike { - $this->program = $program; - $this->program_id = $program->getId(); + $this->project = $project; + $this->project_id = $project->getId(); return $this; } - public function getProgram(): Program + public function getProject(): Project { - return $this->program; + return $this->project; } - public function getProgramId(): string + public function getProjectId(): string { - return $this->program_id; + return $this->project_id; } - public function setUser(User $user): ProgramLike + public function setUser(User $user): ProjectLike { $this->user = $user; $this->user_id = $user->getId(); @@ -156,7 +156,7 @@ public function getUserId(): string return $this->user_id; } - public function setType(int $type): ProgramLike + public function setType(int $type): ProjectLike { $this->type = $type; @@ -178,7 +178,7 @@ public function getCreatedAt(): ?\DateTime return $this->created_at; } - public function setCreatedAt(\DateTime $created_at): ProgramLike + public function setCreatedAt(\DateTime $created_at): ProjectLike { $this->created_at = $created_at; diff --git a/src/DB/Entity/Project/Remix/ProgramCatrobatRemixRelationInterface.php b/src/DB/Entity/Project/Remix/ProjectCatrobatRemixRelationInterface.php similarity index 60% rename from src/DB/Entity/Project/Remix/ProgramCatrobatRemixRelationInterface.php rename to src/DB/Entity/Project/Remix/ProjectCatrobatRemixRelationInterface.php index ef8976fa5f..2d49422d06 100644 --- a/src/DB/Entity/Project/Remix/ProgramCatrobatRemixRelationInterface.php +++ b/src/DB/Entity/Project/Remix/ProjectCatrobatRemixRelationInterface.php @@ -2,13 +2,13 @@ namespace App\DB\Entity\Project\Remix; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; -interface ProgramCatrobatRemixRelationInterface +interface ProjectCatrobatRemixRelationInterface { - public function getAncestor(): Program; + public function getAncestor(): Project; - public function getDescendant(): Program; + public function getDescendant(): Project; public function getCreatedAt(): ?\DateTime; diff --git a/src/DB/Entity/Project/Remix/ProgramRemixBackwardRelation.php b/src/DB/Entity/Project/Remix/ProjectRemixBackwardRelation.php similarity index 74% rename from src/DB/Entity/Project/Remix/ProgramRemixBackwardRelation.php rename to src/DB/Entity/Project/Remix/ProjectRemixBackwardRelation.php index b07dd0caac..18b0a03722 100644 --- a/src/DB/Entity/Project/Remix/ProgramRemixBackwardRelation.php +++ b/src/DB/Entity/Project/Remix/ProjectRemixBackwardRelation.php @@ -2,8 +2,8 @@ namespace App\DB\Entity\Project\Remix; -use App\DB\Entity\Project\Program; -use App\DB\EntityRepository\Project\ProgramRemixBackwardRepository; +use App\DB\Entity\Project\Project; +use App\DB\EntityRepository\Project\ProjectRemixBackwardRepository; use App\Utils\TimeUtils; use DateTime; use Doctrine\ORM\Mapping as ORM; @@ -11,11 +11,11 @@ /** * @ORM\HasLifecycleCallbacks * - * @ORM\Table(name="program_remix_backward_relation") + * @ORM\Table(name="project_remix_backward_relation") * - * @ORM\Entity(repositoryClass=ProgramRemixBackwardRepository::class) + * @ORM\Entity(repositoryClass=ProjectRemixBackwardRepository::class) */ -class ProgramRemixBackwardRelation implements ProgramRemixRelationInterface, ProgramCatrobatRemixRelationInterface, \Stringable +class ProjectRemixBackwardRelation implements ProjectRemixRelationInterface, ProjectCatrobatRemixRelationInterface, \Stringable { /** * ----------------------------------------------------------------------------------------------------------------- @@ -33,11 +33,11 @@ class ProgramRemixBackwardRelation implements ProgramRemixRelationInterface, Pro protected string $parent_id; /** - * @ORM\ManyToOne(targetEntity=Program::class, inversedBy="catrobat_remix_backward_child_relations", fetch="LAZY") + * @ORM\ManyToOne(targetEntity=Project::class, inversedBy="catrobat_remix_backward_child_relations", fetch="LAZY") * * @ORM\JoinColumn(name="parent_id", referencedColumnName="id") */ - protected Program $parent; + protected Project $parent; /** * @ORM\Id @@ -47,12 +47,12 @@ class ProgramRemixBackwardRelation implements ProgramRemixRelationInterface, Pro protected string $child_id; /** - * @ORM\ManyToOne(targetEntity=Program::class, inversedBy="catrobat_remix_backward_parent_relations", + * @ORM\ManyToOne(targetEntity=Project::class, inversedBy="catrobat_remix_backward_parent_relations", * fetch="LAZY") * * @ORM\JoinColumn(name="child_id", referencedColumnName="id") */ - protected Program $child; + protected Project $child; /** * @ORM\Column(type="datetime") @@ -64,7 +64,7 @@ class ProgramRemixBackwardRelation implements ProgramRemixRelationInterface, Pro */ protected ?\DateTime $seen_at = null; - public function __construct(Program $parent, Program $child) + public function __construct(Project $parent, Project $child) { $this->setParent($parent); $this->setChild($child); @@ -87,7 +87,7 @@ public function updateTimestamps(): void } } - public function setParent(Program $parent): ProgramRemixBackwardRelation + public function setParent(Project $parent): ProjectRemixBackwardRelation { $this->parent = $parent; $this->parent_id = $parent->getId(); @@ -95,7 +95,7 @@ public function setParent(Program $parent): ProgramRemixBackwardRelation return $this; } - public function getParent(): Program + public function getParent(): Project { return $this->parent; } @@ -105,7 +105,7 @@ public function getParentId(): string return $this->parent_id; } - public function setChild(Program $child): ProgramRemixBackwardRelation + public function setChild(Project $child): ProjectRemixBackwardRelation { $this->child = $child; $this->child_id = $child->getId(); @@ -113,7 +113,7 @@ public function setChild(Program $child): ProgramRemixBackwardRelation return $this; } - public function getChild(): Program + public function getChild(): Project { return $this->child; } @@ -150,15 +150,15 @@ public function setSeenAt(?\DateTime $seen_at): void public function getUniqueKey(): string { - return sprintf('ProgramRemixBackwardRelation(%d,%d)', $this->parent_id, $this->child_id); + return sprintf('ProjectRemixBackwardRelation(%d,%d)', $this->parent_id, $this->child_id); } - public function getAncestor(): Program + public function getAncestor(): Project { return $this->parent; } - public function getDescendant(): Program + public function getDescendant(): Project { return $this->child; } diff --git a/src/DB/Entity/Project/Remix/ProgramRemixRelation.php b/src/DB/Entity/Project/Remix/ProjectRemixRelation.php similarity index 77% rename from src/DB/Entity/Project/Remix/ProgramRemixRelation.php rename to src/DB/Entity/Project/Remix/ProjectRemixRelation.php index ad7a4714e7..cbb3cddad4 100644 --- a/src/DB/Entity/Project/Remix/ProgramRemixRelation.php +++ b/src/DB/Entity/Project/Remix/ProjectRemixRelation.php @@ -2,8 +2,8 @@ namespace App\DB\Entity\Project\Remix; -use App\DB\Entity\Project\Program; -use App\DB\EntityRepository\Project\ProgramRemixRepository; +use App\DB\Entity\Project\Project; +use App\DB\EntityRepository\Project\ProjectRemixRepository; use App\Utils\TimeUtils; use DateTime; use Doctrine\ORM\Mapping as ORM; @@ -11,11 +11,11 @@ /** * @ORM\HasLifecycleCallbacks * - * @ORM\Table(name="program_remix_relation") + * @ORM\Table(name="project_remix_relation") * - * @ORM\Entity(repositoryClass=ProgramRemixRepository::class) + * @ORM\Entity(repositoryClass=ProjectRemixRepository::class) */ -class ProgramRemixRelation implements ProgramRemixRelationInterface, ProgramCatrobatRemixRelationInterface, \Stringable +class ProjectRemixRelation implements ProjectRemixRelationInterface, ProjectCatrobatRemixRelationInterface, \Stringable { /** * ----------------------------------------------------------------------------------------------------------------- @@ -33,12 +33,12 @@ class ProgramRemixRelation implements ProgramRemixRelationInterface, ProgramCatr protected string $ancestor_id; /** - * @ORM\ManyToOne(targetEntity=Program::class, inversedBy="catrobat_remix_descendant_relations", + * @ORM\ManyToOne(targetEntity=Project::class, inversedBy="catrobat_remix_descendant_relations", * fetch="LAZY") * * @ORM\JoinColumn(name="ancestor_id", referencedColumnName="id") */ - protected Program $ancestor; + protected Project $ancestor; /** * @ORM\Id @@ -48,12 +48,12 @@ class ProgramRemixRelation implements ProgramRemixRelationInterface, ProgramCatr protected string $descendant_id; /** - * @ORM\ManyToOne(targetEntity=Program::class, inversedBy="catrobat_remix_ancestor_relations", + * @ORM\ManyToOne(targetEntity=Project::class, inversedBy="catrobat_remix_ancestor_relations", * fetch="LAZY") * * @ORM\JoinColumn(name="descendant_id", referencedColumnName="id") */ - protected Program $descendant; + protected Project $descendant; /** * @ORM\Id @@ -72,7 +72,7 @@ class ProgramRemixRelation implements ProgramRemixRelationInterface, ProgramCatr */ protected ?\DateTime $seen_at = null; - public function __construct(Program $ancestor, Program $descendant, int $depth) + public function __construct(Project $ancestor, Project $descendant, int $depth) { $this->setAncestor($ancestor); $this->setDescendant($descendant); @@ -96,13 +96,13 @@ public function updateTimestamps(): void } } - public function setAncestor(Program $ancestor): void + public function setAncestor(Project $ancestor): void { $this->ancestor = $ancestor; $this->ancestor_id = $ancestor->getId(); } - public function getAncestor(): Program + public function getAncestor(): Project { return $this->ancestor; } @@ -112,13 +112,13 @@ public function getAncestorId(): string return $this->ancestor_id; } - public function setDescendant(Program $descendant): void + public function setDescendant(Project $descendant): void { $this->descendant = $descendant; $this->descendant_id = $descendant->getId(); } - public function getDescendant(): Program + public function getDescendant(): Project { return $this->descendant; } @@ -160,6 +160,6 @@ public function setSeenAt(?\DateTime $seen_at): void public function getUniqueKey(): string { - return sprintf('ProgramRemixRelation(%d,%d,%d)', $this->ancestor_id, $this->descendant_id, $this->depth); + return sprintf('ProjectRemixRelation(%d,%d,%d)', $this->ancestor_id, $this->descendant_id, $this->depth); } } diff --git a/src/DB/Entity/Project/Remix/ProgramRemixRelationInterface.php b/src/DB/Entity/Project/Remix/ProjectRemixRelationInterface.php similarity index 76% rename from src/DB/Entity/Project/Remix/ProgramRemixRelationInterface.php rename to src/DB/Entity/Project/Remix/ProjectRemixRelationInterface.php index 147d636371..89460851a2 100644 --- a/src/DB/Entity/Project/Remix/ProgramRemixRelationInterface.php +++ b/src/DB/Entity/Project/Remix/ProjectRemixRelationInterface.php @@ -2,7 +2,7 @@ namespace App\DB\Entity\Project\Remix; -interface ProgramRemixRelationInterface +interface ProjectRemixRelationInterface { public function getUniqueKey(): string; diff --git a/src/DB/Entity/Project/Scratch/ScratchProgram.php b/src/DB/Entity/Project/Scratch/ScratchProject.php similarity index 82% rename from src/DB/Entity/Project/Scratch/ScratchProgram.php rename to src/DB/Entity/Project/Scratch/ScratchProject.php index 868f07da3b..232449598c 100644 --- a/src/DB/Entity/Project/Scratch/ScratchProgram.php +++ b/src/DB/Entity/Project/Scratch/ScratchProject.php @@ -2,7 +2,7 @@ namespace App\DB\Entity\Project\Scratch; -use App\DB\EntityRepository\Project\ScratchProgramRepository; +use App\DB\EntityRepository\Project\ScratchProjectRepository; use App\Utils\TimeUtils; use DateTime; use Doctrine\ORM\Mapping as ORM; @@ -10,11 +10,11 @@ /** * @ORM\HasLifecycleCallbacks * - * @ORM\Table(name="scratch_program") + * @ORM\Table(name="scratch_project") * - * @ORM\Entity(repositoryClass=ScratchProgramRepository::class) + * @ORM\Entity(repositoryClass=ScratchProjectRepository::class) */ -class ScratchProgram +class ScratchProject { /** * @ORM\Column(type="string", length=300, nullable=true) @@ -37,7 +37,7 @@ class ScratchProgram protected ?\DateTime $last_modified_at = null; /** - * ScratchProgram constructor. + * ScratchProject constructor. * * @throws \Exception */ @@ -51,21 +51,21 @@ public function __construct(/** $this->updateLastModifiedTimestamp(); } - public function setName(?string $name): ScratchProgram + public function setName(?string $name): ScratchProject { $this->name = $name; return $this; } - public function setDescription(?string $description): ScratchProgram + public function setDescription(?string $description): ScratchProject { $this->description = $description; return $this; } - public function setUsername(?string $username): ScratchProgram + public function setUsername(?string $username): ScratchProject { $this->username = $username; @@ -102,7 +102,7 @@ public function getUsername(): ?string return $this->username; } - public function setLastModifiedAt(\DateTime $last_modified_at): ScratchProgram + public function setLastModifiedAt(\DateTime $last_modified_at): ScratchProject { $this->last_modified_at = $last_modified_at; diff --git a/src/DB/Entity/Project/Scratch/ScratchProgramRemixRelation.php b/src/DB/Entity/Project/Scratch/ScratchProjectRemixRelation.php similarity index 73% rename from src/DB/Entity/Project/Scratch/ScratchProgramRemixRelation.php rename to src/DB/Entity/Project/Scratch/ScratchProjectRemixRelation.php index 65527c9494..025651e9cc 100644 --- a/src/DB/Entity/Project/Scratch/ScratchProgramRemixRelation.php +++ b/src/DB/Entity/Project/Scratch/ScratchProjectRemixRelation.php @@ -2,17 +2,17 @@ namespace App\DB\Entity\Project\Scratch; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\Remix\ProgramRemixRelationInterface; -use App\DB\EntityRepository\Project\ScratchProgramRemixRepository; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\Remix\ProjectRemixRelationInterface; +use App\DB\EntityRepository\Project\ScratchProjectRemixRepository; use Doctrine\ORM\Mapping as ORM; /** - * @ORM\Table(name="scratch_program_remix_relation") + * @ORM\Table(name="scratch_project_remix_relation") * - * @ORM\Entity(repositoryClass=ScratchProgramRemixRepository::class) + * @ORM\Entity(repositoryClass=ScratchProjectRemixRepository::class) */ -class ScratchProgramRemixRelation implements ProgramRemixRelationInterface, \Stringable +class ScratchProjectRemixRelation implements ProjectRemixRelationInterface, \Stringable { /** * ----------------------------------------------------------------------------------------------------------------- @@ -38,16 +38,16 @@ class ScratchProgramRemixRelation implements ProgramRemixRelationInterface, \Str /** * @ORM\ManyToOne( - * targetEntity=Program::class, + * targetEntity=Project::class, * inversedBy="scratch_remix_parent_relations", * fetch="LAZY" * ) * * @ORM\JoinColumn(name="catrobat_child_id", referencedColumnName="id") */ - protected Program $catrobat_child; + protected Project $catrobat_child; - public function __construct(string $scratch_parent_id, Program $catrobat_child) + public function __construct(string $scratch_parent_id, Project $catrobat_child) { $this->setScratchParentId($scratch_parent_id); $this->setCatrobatChild($catrobat_child); @@ -58,7 +58,7 @@ public function __toString(): string return '(Scratch: #'.$this->scratch_parent_id.', Catrobat: #'.$this->catrobat_child_id.')'; } - public function setScratchParentId(string $scratch_parent_id): ScratchProgramRemixRelation + public function setScratchParentId(string $scratch_parent_id): ScratchProjectRemixRelation { $this->scratch_parent_id = $scratch_parent_id; @@ -70,7 +70,7 @@ public function getScratchParentId(): string return $this->scratch_parent_id; } - public function setCatrobatChild(Program $catrobat_child): ScratchProgramRemixRelation + public function setCatrobatChild(Project $catrobat_child): ScratchProjectRemixRelation { $this->catrobat_child = $catrobat_child; $this->catrobat_child_id = $catrobat_child->getId(); @@ -78,7 +78,7 @@ public function setCatrobatChild(Program $catrobat_child): ScratchProgramRemixRe return $this; } - public function getCatrobatChild(): Program + public function getCatrobatChild(): Project { return $this->catrobat_child; } @@ -95,6 +95,6 @@ public function getDepth(): int public function getUniqueKey(): string { - return sprintf('ScratchProgramRemixRelation(%d, %d)', $this->scratch_parent_id, $this->catrobat_child_id); + return sprintf('ScratchProjectRemixRelation(%d, %d)', $this->scratch_parent_id, $this->catrobat_child_id); } } diff --git a/src/DB/Entity/Project/Special/ExampleProgram.php b/src/DB/Entity/Project/Special/ExampleProject.php similarity index 68% rename from src/DB/Entity/Project/Special/ExampleProgram.php rename to src/DB/Entity/Project/Special/ExampleProject.php index 1c61938096..06d15f84ce 100644 --- a/src/DB/Entity/Project/Special/ExampleProgram.php +++ b/src/DB/Entity/Project/Special/ExampleProject.php @@ -2,7 +2,7 @@ namespace App\DB\Entity\Project\Special; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\EntityRepository\Project\Special\ExampleRepository; use App\Project\EventListener\ExampleProjectImageListener; use Doctrine\ORM\Mapping as ORM; @@ -15,23 +15,23 @@ * * @ORM\Table(name="example") */ -class ExampleProgram extends SpecialProgram +class ExampleProject extends SpecialProject { - public function setImageType(string $image): ExampleProgram + public function setImageType(string $image): ExampleProject { $this->imagetype = $image; return $this; } - public function setProgram(?Program $program): ExampleProgram + public function setProject(?Project $project): ExampleProject { - $this->program = $program; + $this->project = $project; return $this; } - public function setActive(bool $active): ExampleProgram + public function setActive(bool $active): ExampleProject { $this->active = $active; diff --git a/src/DB/Entity/Project/Special/FeaturedProgram.php b/src/DB/Entity/Project/Special/FeaturedProject.php similarity index 71% rename from src/DB/Entity/Project/Special/FeaturedProgram.php rename to src/DB/Entity/Project/Special/FeaturedProject.php index 141f472342..fc79acbf3c 100644 --- a/src/DB/Entity/Project/Special/FeaturedProgram.php +++ b/src/DB/Entity/Project/Special/FeaturedProject.php @@ -2,7 +2,7 @@ namespace App\DB\Entity\Project\Special; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\EntityRepository\Project\Special\FeaturedRepository; use App\Project\EventListener\FeaturedProjectImageListener; use Doctrine\ORM\Mapping as ORM; @@ -15,35 +15,35 @@ * * @ORM\Table(name="featured") */ -class FeaturedProgram extends SpecialProgram +class FeaturedProject extends SpecialProject { /** * @ORM\Column(type="string", nullable=true) */ protected ?string $url = null; - public function setImageType(string $image): FeaturedProgram + public function setImageType(string $image): FeaturedProject { $this->imagetype = $image; return $this; } - public function setProgram(?Program $program): FeaturedProgram + public function setProject(?Project $project): FeaturedProject { - $this->program = $program; + $this->project = $project; return $this; } - public function setUrl(?string $url): FeaturedProgram + public function setUrl(?string $url): FeaturedProject { $this->url = $url; return $this; } - public function setActive(bool $active): FeaturedProgram + public function setActive(bool $active): FeaturedProject { $this->active = $active; diff --git a/src/DB/Entity/Project/Special/SpecialProgram.php b/src/DB/Entity/Project/Special/SpecialProject.php similarity index 85% rename from src/DB/Entity/Project/Special/SpecialProgram.php rename to src/DB/Entity/Project/Special/SpecialProject.php index 985a6671ee..946f47c6fe 100644 --- a/src/DB/Entity/Project/Special/SpecialProgram.php +++ b/src/DB/Entity/Project/Special/SpecialProject.php @@ -3,12 +3,12 @@ namespace App\DB\Entity\Project\Special; use App\DB\Entity\Flavor; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\HttpFoundation\File\File; -class SpecialProgram +class SpecialProject { public ?File $file = null; @@ -51,9 +51,9 @@ class SpecialProgram protected bool $for_ios = false; /** - * @ORM\ManyToOne(targetEntity="App\DB\Entity\Project\Program", fetch="EAGER") + * @ORM\ManyToOne(targetEntity="App\DB\Entity\Project\Project", fetch="EAGER") */ - protected ?Program $program = null; + protected ?Project $project = null; public function getFlavor(): ?Flavor { @@ -75,9 +75,9 @@ public function getId(): ?int return $this->id; } - public function getProgram(): ?Program + public function getProject(): ?Project { - return $this->program; + return $this->project; } public function getActive(): bool @@ -112,11 +112,11 @@ public function isExample(): bool public function getName(): string { - return $this->program->getName(); + return $this->project->getName(); } public function getUser(): ?User { - return $this->getProgram()->getUser(); + return $this->getProject()->getUser(); } } diff --git a/src/DB/Entity/Project/Tag.php b/src/DB/Entity/Project/Tag.php index ce283d0eb4..5436b954f7 100644 --- a/src/DB/Entity/Project/Tag.php +++ b/src/DB/Entity/Project/Tag.php @@ -42,9 +42,9 @@ class Tag protected ?int $id = null; /** - * @ORM\ManyToMany(targetEntity=Program::class, mappedBy="tags") + * @ORM\ManyToMany(targetEntity=Project::class, mappedBy="tags") */ - protected Collection $programs; + protected Collection $projects; /** * @ORM\Column(name="internal_title", type="string", nullable=false) @@ -63,7 +63,7 @@ class Tag public function __construct() { - $this->programs = new ArrayCollection(); + $this->projects = new ArrayCollection(); } public function getId(): ?int @@ -107,26 +107,26 @@ public function setEnabled(bool $enabled): Tag return $this; } - public function addProgram(Program $program): void + public function addProject(Project $project): void { - if ($this->programs->contains($program)) { + if ($this->projects->contains($project)) { return; } - $this->programs->add($program); + $this->projects->add($project); } public function getProjectCount(): int { - return count($this->programs); + return count($this->projects); } - public function removeProgram(Program $program): void + public function removeProject(Project $project): void { - $this->programs->removeElement($program); + $this->projects->removeElement($project); } - public function getPrograms(): Collection + public function getProjects(): Collection { - return $this->programs; + return $this->projects; } } diff --git a/src/DB/Entity/Studio/StudioProgram.php b/src/DB/Entity/Studio/StudioProject.php similarity index 76% rename from src/DB/Entity/Studio/StudioProgram.php rename to src/DB/Entity/Studio/StudioProject.php index 03e823cee8..1aef270f17 100644 --- a/src/DB/Entity/Studio/StudioProgram.php +++ b/src/DB/Entity/Studio/StudioProject.php @@ -2,18 +2,18 @@ namespace App\DB\Entity\Studio; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; -use App\DB\EntityRepository\Studios\StudioProgramRepository; +use App\DB\EntityRepository\Studios\StudioProjectRepository; use DateTime; use Doctrine\ORM\Mapping as ORM; /** - * @ORM\Entity(repositoryClass=StudioProgramRepository::class) + * @ORM\Entity(repositoryClass=StudioProjectRepository::class) * - * @ORM\Table(name="studio_program") + * @ORM\Table(name="studio_project") */ -class StudioProgram +class StudioProject { /** * @ORM\Id @@ -39,11 +39,11 @@ class StudioProgram protected StudioActivity $activity; /** - * @ORM\ManyToOne(targetEntity=Program::class, cascade={"persist"}) + * @ORM\ManyToOne(targetEntity=Project::class, cascade={"persist"}) * - * @ORM\JoinColumn(name="program", referencedColumnName="id", nullable=false, onDelete="CASCADE") + * @ORM\JoinColumn(name="project", referencedColumnName="id", nullable=false, onDelete="CASCADE") */ - protected Program $program; + protected Project $project; /** * @ORM\ManyToOne(targetEntity=User::class, cascade={"persist"}) @@ -67,7 +67,7 @@ public function getId(): ?int return $this->id; } - public function setId(?int $id): StudioProgram + public function setId(?int $id): StudioProject { $this->id = $id; @@ -79,7 +79,7 @@ public function getStudio(): Studio return $this->studio; } - public function setStudio(Studio $studio): StudioProgram + public function setStudio(Studio $studio): StudioProject { $this->studio = $studio; @@ -91,21 +91,21 @@ public function getActivity(): StudioActivity return $this->activity; } - public function setActivity(StudioActivity $activity): StudioProgram + public function setActivity(StudioActivity $activity): StudioProject { $this->activity = $activity; return $this; } - public function getProgram(): Program + public function getProject(): Project { - return $this->program; + return $this->project; } - public function setProgram(Program $program): StudioProgram + public function setProject(Project $project): StudioProject { - $this->program = $program; + $this->project = $project; return $this; } @@ -115,7 +115,7 @@ public function getUser(): User return $this->user; } - public function setUser(User $user): StudioProgram + public function setUser(User $user): StudioProject { $this->user = $user; @@ -127,7 +127,7 @@ public function getUpdatedOn(): ?\DateTime return $this->updated_on; } - public function setUpdatedOn(?\DateTime $updated_on): StudioProgram + public function setUpdatedOn(?\DateTime $updated_on): StudioProject { $this->updated_on = $updated_on; @@ -139,7 +139,7 @@ public function getCreatedOn(): \DateTime return $this->created_on; } - public function setCreatedOn(\DateTime $created_on): StudioProgram + public function setCreatedOn(\DateTime $created_on): StudioProject { $this->created_on = $created_on; diff --git a/src/DB/Entity/Translation/ProjectCustomTranslation.php b/src/DB/Entity/Translation/ProjectCustomTranslation.php index e4a7a08646..01039edea1 100644 --- a/src/DB/Entity/Translation/ProjectCustomTranslation.php +++ b/src/DB/Entity/Translation/ProjectCustomTranslation.php @@ -2,7 +2,7 @@ namespace App\DB\Entity\Translation; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\EntityRepository\Translation\ProjectCustomTranslationRepository; use Doctrine\ORM\Mapping as ORM; @@ -40,13 +40,13 @@ class ProjectCustomTranslation public function __construct( /** * @ORM\ManyToOne( - * targetEntity=Program::class, + * targetEntity=Project::class, * inversedBy="custom_translations" * ) * * @ORM\JoinColumn(name="project_id", referencedColumnName="id", onDelete="CASCADE") */ - private Program $project, + private Project $project, /** * @ORM\Column(type="string", length=5) */ @@ -59,14 +59,14 @@ public function getId(): ?int return $this->id; } - public function getProject(): Program + public function getProject(): Project { return $this->project; } - public function setProject(Program $program): void + public function setProject(Project $project): void { - $this->project = $program; + $this->project = $project; } public function getLanguage(): string diff --git a/src/DB/Entity/Translation/ProjectMachineTranslation.php b/src/DB/Entity/Translation/ProjectMachineTranslation.php index 8113e5428a..27c7cc84e2 100644 --- a/src/DB/Entity/Translation/ProjectMachineTranslation.php +++ b/src/DB/Entity/Translation/ProjectMachineTranslation.php @@ -2,7 +2,7 @@ namespace App\DB\Entity\Translation; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping\HasLifecycleCallbacks; @@ -31,16 +31,16 @@ class ProjectMachineTranslation extends MachineTranslation private ?string $cached_credits = null; public function __construct(/** - * @ORM\ManyToOne(targetEntity=Program::class) + * @ORM\ManyToOne(targetEntity=Project::class) * * @ORM\JoinColumn(name="project_id", referencedColumnName="id", onDelete="CASCADE") */ - protected Program $project, string $source_language, string $target_language, string $provider, int $usage_count = 1) + protected Project $project, string $source_language, string $target_language, string $provider, int $usage_count = 1) { parent::__construct($source_language, $target_language, $provider, $usage_count); } - public function getProject(): Program + public function getProject(): Project { return $this->project; } diff --git a/src/DB/Entity/User/Comment/UserComment.php b/src/DB/Entity/User/Comment/UserComment.php index 3314075746..e0a127d89d 100644 --- a/src/DB/Entity/User/Comment/UserComment.php +++ b/src/DB/Entity/User/Comment/UserComment.php @@ -2,7 +2,7 @@ namespace App\DB\Entity\User\Comment; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\Studio\Studio; use App\DB\Entity\Studio\StudioActivity; use App\DB\Entity\User\Notifications\CommentNotification; @@ -19,7 +19,7 @@ * * @ORM\Index(name="parent_id_idx", columns={"parent_id"}), * @ORM\Index(name="user_id_idx", columns={"user_id"}), - * @ORM\Index(name="program_id_idx", columns={"programId"}), + * @ORM\Index(name="project_id_idx", columns={"projectId"}), * @ORM\Index(name="studio_idx", columns={"studio"}), * @ORM\Index(name="upload_date_idx", columns={"uploadDate"}) * } @@ -92,20 +92,20 @@ class UserComment implements \Stringable protected bool $isReported = false; /** - * The Program which this UserComment comments. If this Program gets deleted, this UserComment gets deleted as well. + * The Project which this UserComment comments. If this Project gets deleted, this UserComment gets deleted as well. * * @ORM\ManyToOne( - * targetEntity=Program::class, + * targetEntity=Project::class, * inversedBy="comments" * ) * * @ORM\JoinColumn( - * name="programId", + * name="projectId", * referencedColumnName="id", * nullable=true * ) */ - private ?Program $program = null; + private ?Project $project = null; /** * @ORM\Column(type="integer", nullable=true) @@ -142,19 +142,19 @@ public function __toString(): string } /** - * Returns the Program which this UserComment comments. + * Returns the Project which this UserComment comments. */ - public function getProgram(): ?Program + public function getProject(): ?Project { - return $this->program; + return $this->project; } /** - * Sets the Program which this UserComment comments. + * Sets the Project which this UserComment comments. */ - public function setProgram(Program $program): UserComment + public function setProject(Project $project): UserComment { - $this->program = $program; + $this->project = $project; return $this; } diff --git a/src/DB/Entity/User/Notifications/CatroNotification.php b/src/DB/Entity/User/Notifications/CatroNotification.php index 2677b5f86f..c5b202aba6 100644 --- a/src/DB/Entity/User/Notifications/CatroNotification.php +++ b/src/DB/Entity/User/Notifications/CatroNotification.php @@ -22,7 +22,7 @@ * "comment": "CommentNotification", * "like": "LikeNotification", * "follow": "FollowNotification", - * "follow_project": "NewProgramNotification", + * "follow_project": "NewProjectNotification", * "broadcast_notification": "BroadcastNotification", * "remix_notification": "RemixNotification" * }) diff --git a/src/DB/Entity/User/Notifications/LikeNotification.php b/src/DB/Entity/User/Notifications/LikeNotification.php index e8bb14a584..015d2dc71d 100644 --- a/src/DB/Entity/User/Notifications/LikeNotification.php +++ b/src/DB/Entity/User/Notifications/LikeNotification.php @@ -2,7 +2,7 @@ namespace App\DB\Entity\User\Notifications; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; use Doctrine\ORM\Mapping as ORM; @@ -21,7 +21,7 @@ class LikeNotification extends CatroNotification * * @param User $user the User to which this LikeNotification will be shown * @param User $like_from the User which "like action" to another user triggered this LikeNotification - * @param Program $program the Program to which the ProgramLike and this LikeNotification is notifying, belongs to + * @param Project $project the Project to which the ProjectLike and this LikeNotification is notifying, belongs to */ public function __construct(User $user, /** * The User which "like action" to another user triggered this LikeNotification. @@ -39,20 +39,20 @@ public function __construct(User $user, /** * ) */ private ?User $like_from, /** - * the Program about which this LikeNotification is notifying, belongs to. + * the Project about which this LikeNotification is notifying, belongs to. * * @ORM\ManyToOne( - * targetEntity=Program::class, + * targetEntity=Project::class, * inversedBy="like_notification_mentions" * ) * * @ORM\JoinColumn( - * name="program_id", + * name="project_id", * referencedColumnName="id", * nullable=true * ) */ - private ?Program $program) + private ?Project $project) { parent::__construct($user, '', '', 'reaction'); } @@ -83,18 +83,18 @@ public function getTwigTemplate(): string } /** - * Returns the Program to which the ProgramLike and this LikeNotification is notifying, belongs to. + * Returns the Project to which the ProjectLike and this LikeNotification is notifying, belongs to. */ - public function getProgram(): ?Program + public function getProject(): ?Project { - return $this->program; + return $this->project; } /** - * Sets the Program to which the ProgramLike and this LikeNotification is notifying, belongs to. + * Sets the Project to which the ProjectLike and this LikeNotification is notifying, belongs to. */ - public function setProgram(?Program $program): void + public function setProject(?Project $project): void { - $this->program = $program; + $this->project = $project; } } diff --git a/src/DB/Entity/User/Notifications/NewProgramNotification.php b/src/DB/Entity/User/Notifications/NewProjectNotification.php similarity index 55% rename from src/DB/Entity/User/Notifications/NewProgramNotification.php rename to src/DB/Entity/User/Notifications/NewProjectNotification.php index 060dc5a083..0323f5ef1b 100644 --- a/src/DB/Entity/User/Notifications/NewProgramNotification.php +++ b/src/DB/Entity/User/Notifications/NewProjectNotification.php @@ -2,14 +2,14 @@ namespace App\DB\Entity\User\Notifications; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity */ -class NewProgramNotification extends CatroNotification +class NewProjectNotification extends CatroNotification { /** * You have to set this parameter otherwise the wrong template will be rendered. @@ -17,39 +17,39 @@ class NewProgramNotification extends CatroNotification private string $twig_template = 'Notifications/NotificationTypes/new_project_notification.html.twig'; public function __construct(User $user, /** - * The new Program which triggered this NewProgramNotification. If this Program gets deleted, - * this NewProgramNotification gets deleted as well. + * The new Project which triggered this NewProjectNotification. If this Project gets deleted, + * this NewProjectNotification gets deleted as well. * * @ORM\ManyToOne( - * targetEntity=Program::class, - * inversedBy="new_program_notification_mentions" + * targetEntity=Project::class, + * inversedBy="new_project_notification_mentions" * ) * * @ORM\JoinColumn( - * name="program_id", + * name="project_id", * referencedColumnName="id", * nullable=true * ) */ - private ?Program $program) + private ?Project $project) { parent::__construct($user, '', '', 'follow'); } /** - * Returns the new Program which triggered this NewProgramNotification. + * Returns the new Project which triggered this NewProjectNotification. */ - public function getProgram(): ?Program + public function getProject(): ?Project { - return $this->program; + return $this->project; } /** - * Sets the new Program which triggered this NewProgramNotification. + * Sets the new Project which triggered this NewProjectNotification. */ - public function setProgram(?Program $program): void + public function setProject(?Project $project): void { - $this->program = $program; + $this->project = $project; } /** diff --git a/src/DB/Entity/User/Notifications/RemixNotification.php b/src/DB/Entity/User/Notifications/RemixNotification.php index fc2887f6f3..f681c89bc0 100644 --- a/src/DB/Entity/User/Notifications/RemixNotification.php +++ b/src/DB/Entity/User/Notifications/RemixNotification.php @@ -2,7 +2,7 @@ namespace App\DB\Entity\User\Notifications; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; use Doctrine\ORM\Mapping as ORM; @@ -20,12 +20,12 @@ class RemixNotification extends CatroNotification * RemixNotification constructor. * * @param User $user the User to which this RemixNotification will be shown - * @param User $remix_from the owner of the parent Program - * @param Program $program the parent Program - * @param Program $remix_program the newly remixed child Program + * @param User $remix_from the owner of the parent Project + * @param Project $project the parent Project + * @param Project $remix_project the newly remixed child Project */ public function __construct(User $user, /** - * the owner of the parent Program. + * the owner of the parent Project. * * @ORM\ManyToOne( * targetEntity=User::class @@ -38,40 +38,40 @@ public function __construct(User $user, /** * ) */ private ?User $remix_from, /** - * the parent Program. + * the parent Project. * * @ORM\ManyToOne( - * targetEntity=Program::class, + * targetEntity=Project::class, * inversedBy="remix_notification_mentions_as_parent" * ) * * @ORM\JoinColumn( - * name="program_id", + * name="project_id", * referencedColumnName="id", * nullable=true * ) */ - private ?Program $program, /** - * the newly remixed child Program. + private ?Project $project, /** + * the newly remixed child Project. * * @ORM\ManyToOne( - * targetEntity=Program::class, + * targetEntity=Project::class, * inversedBy="remix_notification_mentions_as_child" * ) * * @ORM\JoinColumn( - * name="remix_program_id", + * name="remix_project_id", * referencedColumnName="id", * nullable=true * ) */ - private ?Program $remix_program) + private ?Project $remix_project) { parent::__construct($user, '', '', 'remix'); } /** - * Returns the owner of the parent Program. + * Returns the owner of the parent Project. */ public function getRemixFrom(): ?User { @@ -79,7 +79,7 @@ public function getRemixFrom(): ?User } /** - * Sets the owner of the parent Program. + * Sets the owner of the parent Project. */ public function setRemixFrom(?User $remix_from): void { @@ -96,34 +96,34 @@ public function getTwigTemplate(): string } /** - * Returns the parent Program. + * Returns the parent Project. */ - public function getProgram(): ?Program + public function getProject(): ?Project { - return $this->program; + return $this->project; } /** - * Sets the parent Program. + * Sets the parent Project. */ - public function setProgram(?Program $program): void + public function setProject(?Project $project): void { - $this->program = $program; + $this->project = $project; } /** - * Returns the child Program. + * Returns the child Project. */ - public function getRemixProgram(): ?Program + public function getRemixProject(): ?Project { - return $this->remix_program; + return $this->remix_project; } /** - * Sets the child Program. + * Sets the child Project. */ - public function setRemixProgram(?Program $remix_program): void + public function setRemixProject(?Project $remix_project): void { - $this->remix_program = $remix_program; + $this->remix_project = $remix_project; } } diff --git a/src/DB/Entity/User/User.php b/src/DB/Entity/User/User.php index d893bc2bbe..c20b69ed08 100644 --- a/src/DB/Entity/User/User.php +++ b/src/DB/Entity/User/User.php @@ -2,9 +2,9 @@ namespace App\DB\Entity\User; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\ProgramInappropriateReport; -use App\DB\Entity\Project\ProgramLike; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\ProjectInappropriateReport; +use App\DB\Entity\Project\ProjectLike; use App\DB\Entity\User\Comment\UserComment; use App\DB\Entity\User\Notifications\CatroNotification; use App\DB\Entity\User\Notifications\FollowNotification; @@ -66,17 +66,17 @@ class User extends BaseUser protected ?string $avatar = null; /** - * Programs owned by this user. - * When this user is deleted, all the programs owned by him should be deleted too. + * Projects owned by this user. + * When this user is deleted, all the projects owned by him should be deleted too. * * @ORM\OneToMany( - * targetEntity=Program::class, + * targetEntity=Project::class, * mappedBy="user", * fetch="EXTRA_LAZY", * cascade={"remove"} * ) */ - protected Collection $programs; + protected Collection $projects; /** * Requests to change the password issued by this user. @@ -157,7 +157,7 @@ class User extends BaseUser /** * @ORM\OneToMany( - * targetEntity=ProgramLike::class, + * targetEntity=ProjectLike::class, * mappedBy="user", * cascade={"persist", "remove"}, * orphanRemoval=true @@ -272,12 +272,12 @@ class User extends BaseUser protected bool $verified = true; /** - * @ORM\OneToMany(targetEntity=ProgramInappropriateReport::class, mappedBy="reporting_user", fetch="EXTRA_LAZY") + * @ORM\OneToMany(targetEntity=ProjectInappropriateReport::class, mappedBy="reporting_user", fetch="EXTRA_LAZY") */ protected Collection $reports_triggered_by_this_user; /** - * @ORM\OneToMany(targetEntity=ProgramInappropriateReport::class, mappedBy="reported_user", fetch="EXTRA_LAZY") + * @ORM\OneToMany(targetEntity=ProjectInappropriateReport::class, mappedBy="reported_user", fetch="EXTRA_LAZY") */ protected Collection $reports_of_this_user; @@ -298,7 +298,7 @@ class User extends BaseUser public function __construct() { - $this->programs = new ArrayCollection(); + $this->projects = new ArrayCollection(); $this->notifications = new ArrayCollection(); $this->comments = new ArrayCollection(); $this->follow_notification_mentions = new ArrayCollection(); @@ -354,21 +354,21 @@ public function getId(): ?string return $this->id; } - public function addProgram(Program $program): User + public function addProject(Project $project): User { - $this->programs[] = $program; + $this->projects[] = $project; return $this; } - public function removeProgram(Program $program): void + public function removeProject(Project $project): void { - $this->programs->removeElement($program); + $this->projects->removeElement($project); } - public function getPrograms(): Collection + public function getProjects(): Collection { - return $this->programs; + return $this->projects; } public function getUploadToken(): ?string diff --git a/src/DB/EntityRepository/Project/ProgramInappropriateReportRepository.php b/src/DB/EntityRepository/Project/ProjectInappropriateReportRepository.php similarity index 59% rename from src/DB/EntityRepository/Project/ProgramInappropriateReportRepository.php rename to src/DB/EntityRepository/Project/ProjectInappropriateReportRepository.php index 5aa670992c..a94323e4fe 100644 --- a/src/DB/EntityRepository/Project/ProgramInappropriateReportRepository.php +++ b/src/DB/EntityRepository/Project/ProjectInappropriateReportRepository.php @@ -2,14 +2,14 @@ namespace App\DB\EntityRepository\Project; -use App\DB\Entity\Project\ProgramInappropriateReport; +use App\DB\Entity\Project\ProjectInappropriateReport; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; -class ProgramInappropriateReportRepository extends ServiceEntityRepository +class ProjectInappropriateReportRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $managerRegistry) { - parent::__construct($managerRegistry, ProgramInappropriateReport::class); + parent::__construct($managerRegistry, ProjectInappropriateReport::class); } } diff --git a/src/DB/EntityRepository/Project/ProgramLikeRepository.php b/src/DB/EntityRepository/Project/ProjectLikeRepository.php similarity index 67% rename from src/DB/EntityRepository/Project/ProgramLikeRepository.php rename to src/DB/EntityRepository/Project/ProjectLikeRepository.php index 71fd10b866..89d7713c19 100644 --- a/src/DB/EntityRepository/Project/ProgramLikeRepository.php +++ b/src/DB/EntityRepository/Project/ProjectLikeRepository.php @@ -2,8 +2,8 @@ namespace App\DB\EntityRepository\Project; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\ProgramLike; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\ProjectLike; use App\DB\Entity\User\User; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\ORM\NonUniqueResultException; @@ -11,22 +11,22 @@ use Doctrine\ORM\Query\Expr\Join; use Doctrine\Persistence\ManagerRegistry; -class ProgramLikeRepository extends ServiceEntityRepository +class ProjectLikeRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $managerRegistry) { - parent::__construct($managerRegistry, ProgramLike::class); + parent::__construct($managerRegistry, ProjectLike::class); } - public function likeTypeCount(string $program_id, int $type): int + public function likeTypeCount(string $project_id, int $type): int { $qb = $this->createQueryBuilder('l'); $result = $qb ->select('l') - ->where($qb->expr()->eq('l.program_id', ':program_id')) + ->where($qb->expr()->eq('l.project_id', ':project_id')) ->andWhere($qb->expr()->eq('l.type', ':type')) - ->setParameter(':program_id', $program_id) + ->setParameter(':project_id', $project_id) ->setParameter(':type', $type) ->distinct() ->getQuery() @@ -42,21 +42,21 @@ public function likeTypesOfProject(string $project_id): array $qb ->select('l.type')->distinct() - ->where($qb->expr()->eq('l.program_id', ':program_id')) - ->setParameter(':program_id', $project_id) + ->where($qb->expr()->eq('l.project_id', ':project_id')) + ->setParameter(':project_id', $project_id) ; return array_map(fn ($x) => $x['type'], $qb->getQuery()->getResult()); } - public function totalLikeCount(string $program_id): int + public function totalLikeCount(string $project_id): int { $qb = $this->createQueryBuilder('l'); $result = $qb ->select('l') - ->where($qb->expr()->eq('l.program_id', ':program_id')) - ->setParameter(':program_id', $program_id) + ->where($qb->expr()->eq('l.project_id', ':project_id')) + ->setParameter(':project_id', $project_id) ->distinct() ->getQuery() ->getResult() @@ -66,24 +66,24 @@ public function totalLikeCount(string $program_id): int } /** - * @return ProgramLike[] + * @return ProjectLike[] */ - public function getLikesOfUsers(array $user_ids, string $exclude_user_id, array $exclude_program_ids, string $flavor): array + public function getLikesOfUsers(array $user_ids, string $exclude_user_id, array $exclude_project_ids, string $flavor): array { $qb = $this->createQueryBuilder('l'); return $qb ->select('l') - ->innerJoin(Program::class, 'p', Join::WITH, $qb->expr()->eq('p.id', 'l.program')->__toString()) + ->innerJoin(Project::class, 'p', Join::WITH, $qb->expr()->eq('p.id', 'l.project')->__toString()) ->where($qb->expr()->in('l.user_id', ':user_ids')) ->andWhere($qb->expr()->neq('IDENTITY(p.user)', ':exclude_user_id')) - ->andWhere($qb->expr()->notIn('p.id', ':exclude_program_ids')) + ->andWhere($qb->expr()->notIn('p.id', ':exclude_project_ids')) ->andWhere($qb->expr()->eq('p.visible', $qb->expr()->literal(true))) ->andWhere($qb->expr()->eq('p.flavor', ':flavor')) ->andWhere($qb->expr()->eq('p.private', $qb->expr()->literal(false))) ->setParameter('user_ids', $user_ids) ->setParameter('exclude_user_id', $exclude_user_id) - ->setParameter('exclude_program_ids', $exclude_program_ids) + ->setParameter('exclude_project_ids', $exclude_project_ids) ->setParameter('flavor', $flavor) ->distinct() ->getQuery() @@ -94,26 +94,26 @@ public function getLikesOfUsers(array $user_ids, string $exclude_user_id, array /** * @throws NoResultException */ - public function addLike(Program $project, User $user, int $type): void + public function addLike(Project $project, User $user, int $type): void { if ($this->likeExists($project, $user, $type)) { // Like exists already, nothing to do. return; } - $obj = new ProgramLike($project, $user, $type); + $obj = new ProjectLike($project, $user, $type); $this->getEntityManager()->persist($obj); $this->getEntityManager()->flush(); } - public function removeLike(Program $project, User $user, int $type): void + public function removeLike(Project $project, User $user, int $type): void { $qb = $this->createQueryBuilder('l'); $qb->delete() - ->where($qb->expr()->eq('l.program_id', ':program_id')) + ->where($qb->expr()->eq('l.project_id', ':project_id')) ->andWhere($qb->expr()->eq('l.user_id', ':user_id')) ->andWhere($qb->expr()->eq('l.type', ':type')) - ->setParameter(':program_id', $project->getId()) + ->setParameter(':project_id', $project->getId()) ->setParameter(':user_id', $user->getId()) ->setParameter(':type', $type) ; @@ -124,14 +124,14 @@ public function removeLike(Program $project, User $user, int $type): void /** * @throws NoResultException */ - public function likeExists(Program $project, User $user, int $type): bool + public function likeExists(Project $project, User $user, int $type): bool { $qb = $this->createQueryBuilder('l'); $qb->select('count(l)') - ->where($qb->expr()->eq('l.program_id', ':program_id')) + ->where($qb->expr()->eq('l.project_id', ':project_id')) ->andWhere($qb->expr()->eq('l.user_id', ':user_id')) ->andWhere($qb->expr()->eq('l.type', ':type')) - ->setParameter(':program_id', $project->getId()) + ->setParameter(':project_id', $project->getId()) ->setParameter(':user_id', $user->getId()) ->setParameter(':type', $type) ; @@ -149,14 +149,14 @@ public function likeExists(Program $project, User $user, int $type): bool * @throws NoResultException * @throws NonUniqueResultException */ - public function areThereOtherLikeTypes(Program $project, User $user, int $type): bool + public function areThereOtherLikeTypes(Project $project, User $user, int $type): bool { $qb = $this->createQueryBuilder('l'); $qb->select('count(l)') - ->where($qb->expr()->eq('l.program_id', ':program_id')) + ->where($qb->expr()->eq('l.project_id', ':project_id')) ->andWhere($qb->expr()->eq('l.user_id', ':user_id')) ->andWhere($qb->expr()->neq('l.type', ':type')) - ->setParameter(':program_id', $project->getId()) + ->setParameter(':project_id', $project->getId()) ->setParameter(':user_id', $user->getId()) ->setParameter(':type', $type) ; diff --git a/src/DB/EntityRepository/Project/ProgramRemixBackwardRepository.php b/src/DB/EntityRepository/Project/ProjectRemixBackwardRepository.php similarity index 59% rename from src/DB/EntityRepository/Project/ProgramRemixBackwardRepository.php rename to src/DB/EntityRepository/Project/ProjectRemixBackwardRepository.php index 835c15e8a6..2f7c878f7f 100644 --- a/src/DB/EntityRepository/Project/ProgramRemixBackwardRepository.php +++ b/src/DB/EntityRepository/Project/ProjectRemixBackwardRepository.php @@ -2,30 +2,30 @@ namespace App\DB\EntityRepository\Project; -use App\DB\Entity\Project\Remix\ProgramRemixBackwardRelation; +use App\DB\Entity\Project\Remix\ProjectRemixBackwardRelation; use App\DB\Entity\User\User; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\ORM\Query\Expr\Join; use Doctrine\Persistence\ManagerRegistry; -class ProgramRemixBackwardRepository extends ServiceEntityRepository +class ProjectRemixBackwardRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $managerRegistry) { - parent::__construct($managerRegistry, ProgramRemixBackwardRelation::class); + parent::__construct($managerRegistry, ProjectRemixBackwardRelation::class); } /** - * @return ProgramRemixBackwardRelation[] + * @return ProjectRemixBackwardRelation[] */ - public function getParentRelations(array $program_ids): array + public function getParentRelations(array $project_ids): array { $qb = $this->createQueryBuilder('b'); return $qb ->select('b') - ->where('b.child_id IN (:program_ids)') - ->setParameter('program_ids', $program_ids) + ->where('b.child_id IN (:project_ids)') + ->setParameter('project_ids', $project_ids) ->distinct() ->getQuery() ->getResult() @@ -33,18 +33,18 @@ public function getParentRelations(array $program_ids): array } /** - * @return ProgramRemixBackwardRelation[] + * @return ProjectRemixBackwardRelation[] */ - public function getDirectEdgeRelations(array $edge_start_program_ids, array $edge_end_program_ids): array + public function getDirectEdgeRelations(array $edge_start_project_ids, array $edge_end_project_ids): array { $qb = $this->createQueryBuilder('b'); return $qb ->select('b') - ->where('b.parent_id IN (:edge_start_program_ids)') - ->andWhere('b.child_id IN (:edge_end_program_ids)') - ->setParameter('edge_start_program_ids', $edge_start_program_ids) - ->setParameter('edge_end_program_ids', $edge_end_program_ids) + ->where('b.parent_id IN (:edge_start_project_ids)') + ->andWhere('b.child_id IN (:edge_end_project_ids)') + ->setParameter('edge_start_project_ids', $edge_start_project_ids) + ->setParameter('edge_end_project_ids', $edge_end_project_ids) ->distinct() ->getQuery() ->getResult() @@ -52,18 +52,18 @@ public function getDirectEdgeRelations(array $edge_start_program_ids, array $edg } /** - * @param string[] $parent_program_ids + * @param string[] $parent_project_ids */ - public function removeParentRelations(string $program_id, array $parent_program_ids): void + public function removeParentRelations(string $project_id, array $parent_project_ids): void { $qb = $this->createQueryBuilder('b'); $qb ->delete() - ->where('b.parent_id IN (:parent_program_ids)') - ->andWhere($qb->expr()->eq('b.child_id', ':program_id')) - ->setParameter('parent_program_ids', $parent_program_ids) - ->setParameter('program_id', $program_id) + ->where('b.parent_id IN (:parent_project_ids)') + ->andWhere($qb->expr()->eq('b.child_id', ':project_id')) + ->setParameter('parent_project_ids', $parent_project_ids) + ->setParameter('project_id', $project_id) ->getQuery() ->execute() ; @@ -81,7 +81,7 @@ public function removeAllRelations(): void } /** - * @return ProgramRemixBackwardRelation[] + * @return ProjectRemixBackwardRelation[] */ public function getUnseenChildRelationsOfUser(User $user): array { @@ -115,14 +115,14 @@ public function markAllUnseenRelationsAsSeen(\DateTime $seen_at): void ; } - public function remixCount(string $program_id): int + public function remixCount(string $project_id): int { $qb = $this->createQueryBuilder('b'); $result = $qb ->select('b') - ->where($qb->expr()->eq('b.parent_id', ':program_id')) - ->setParameter('program_id', $program_id) + ->where($qb->expr()->eq('b.parent_id', ':project_id')) + ->setParameter('project_id', $project_id) ->distinct() ->getQuery() ->getResult() diff --git a/src/DB/EntityRepository/Project/ProgramRemixRepository.php b/src/DB/EntityRepository/Project/ProjectRemixRepository.php similarity index 65% rename from src/DB/EntityRepository/Project/ProgramRemixRepository.php rename to src/DB/EntityRepository/Project/ProjectRemixRepository.php index faf8fa22fb..375f6f11a2 100644 --- a/src/DB/EntityRepository/Project/ProgramRemixRepository.php +++ b/src/DB/EntityRepository/Project/ProjectRemixRepository.php @@ -2,42 +2,42 @@ namespace App\DB\EntityRepository\Project; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\Remix\ProgramRemixRelation; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\Remix\ProjectRemixRelation; use App\DB\Entity\User\User; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\ORM\Query\Expr\Join; use Doctrine\Persistence\ManagerRegistry; -class ProgramRemixRepository extends ServiceEntityRepository +class ProjectRemixRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $managerRegistry) { - parent::__construct($managerRegistry, ProgramRemixRelation::class); + parent::__construct($managerRegistry, ProjectRemixRelation::class); } - public function getAncestorRelations(array $descendant_program_ids): array + public function getAncestorRelations(array $descendant_project_ids): array { $qb = $this->createQueryBuilder('r'); return $qb ->select('r') ->where('r.descendant_id IN (:descendant_ids)') - ->setParameter('descendant_ids', $descendant_program_ids) + ->setParameter('descendant_ids', $descendant_project_ids) ->distinct() ->getQuery() ->getResult() ; } - public function getAncestorIds(array $descendant_program_ids): array + public function getAncestorIds(array $descendant_project_ids): array { - $parents_catrobat_ancestor_relations = $this->getAncestorRelations($descendant_program_ids); + $parents_catrobat_ancestor_relations = $this->getAncestorRelations($descendant_project_ids); - return array_unique(array_map(fn (ProgramRemixRelation $relation) => $relation->getAncestorId(), $parents_catrobat_ancestor_relations)); + return array_unique(array_map(fn (ProjectRemixRelation $relation) => $relation->getAncestorId(), $parents_catrobat_ancestor_relations)); } - public function getParentAncestorRelations(array $descendant_program_ids): array + public function getParentAncestorRelations(array $descendant_project_ids): array { $qb = $this->createQueryBuilder('r'); @@ -45,7 +45,7 @@ public function getParentAncestorRelations(array $descendant_program_ids): array ->select('r') ->where('r.descendant_id IN (:descendant_ids)') ->andWhere($qb->expr()->eq('r.depth', $qb->expr()->literal(1))) - ->setParameter('descendant_ids', $descendant_program_ids) + ->setParameter('descendant_ids', $descendant_project_ids) ->distinct() ->getQuery() ->getResult() @@ -53,16 +53,16 @@ public function getParentAncestorRelations(array $descendant_program_ids): array } public function getDirectAndIndirectDescendantRelations( - array $ancestor_program_ids_to_exclude, array $descendant_program_ids + array $ancestor_project_ids_to_exclude, array $descendant_project_ids ): array { $qb = $this->createQueryBuilder('r'); return $qb ->select('r') - ->where('r.ancestor_id NOT IN (:ancestor_program_ids_to_exclude)') - ->andWhere('r.descendant_id IN (:descendant_program_ids)') - ->setParameter('ancestor_program_ids_to_exclude', $ancestor_program_ids_to_exclude) - ->setParameter('descendant_program_ids', $descendant_program_ids) + ->where('r.ancestor_id NOT IN (:ancestor_project_ids_to_exclude)') + ->andWhere('r.descendant_id IN (:descendant_project_ids)') + ->setParameter('ancestor_project_ids_to_exclude', $ancestor_project_ids_to_exclude) + ->setParameter('descendant_project_ids', $descendant_project_ids) ->distinct() ->getQuery() ->getResult() @@ -70,25 +70,25 @@ public function getDirectAndIndirectDescendantRelations( } public function getDirectAndIndirectDescendantIds( - array $ancestor_program_ids_to_exclude, array $descendant_program_ids + array $ancestor_project_ids_to_exclude, array $descendant_project_ids ): array { $direct_and_indirect_descendant_relations = $this - ->getDirectAndIndirectDescendantRelations($ancestor_program_ids_to_exclude, $descendant_program_ids) + ->getDirectAndIndirectDescendantRelations($ancestor_project_ids_to_exclude, $descendant_project_ids) ; - return array_unique(array_map(fn (ProgramRemixRelation $relation) => $relation->getAncestorId(), $direct_and_indirect_descendant_relations)); + return array_unique(array_map(fn (ProjectRemixRelation $relation) => $relation->getAncestorId(), $direct_and_indirect_descendant_relations)); } - public function getRootProgramIds(array $program_ids): array + public function getRootProjectIds(array $project_ids): array { $qb = $this->createQueryBuilder('r'); $result_data = $qb ->select('r.ancestor_id') - ->innerJoin(Program::class, 'p', Join::WITH, $qb->expr()->eq('r.ancestor_id', 'p.id')->__toString()) - ->where('r.descendant_id IN (:program_ids)') + ->innerJoin(Project::class, 'p', Join::WITH, $qb->expr()->eq('r.ancestor_id', 'p.id')->__toString()) + ->where('r.descendant_id IN (:project_ids)') ->andWhere($qb->expr()->eq('p.remix_root', $qb->expr()->literal(true))) - ->setParameter('program_ids', $program_ids) + ->setParameter('project_ids', $project_ids) ->distinct() ->getQuery() ->getResult() @@ -97,54 +97,54 @@ public function getRootProgramIds(array $program_ids): array return array_unique(array_map(fn ($row) => $row['ancestor_id'], $result_data)); } - public function getDescendantRelations(array $ancestor_program_ids): array + public function getDescendantRelations(array $ancestor_project_ids): array { $qb = $this->createQueryBuilder('r'); return $qb ->select('r') - ->where('r.ancestor_id IN (:ancestor_program_ids)') - ->setParameter('ancestor_program_ids', $ancestor_program_ids) + ->where('r.ancestor_id IN (:ancestor_project_ids)') + ->setParameter('ancestor_project_ids', $ancestor_project_ids) ->distinct() ->getQuery() ->getResult() ; } - public function getDescendantIds(array $ancestor_program_ids): array + public function getDescendantIds(array $ancestor_project_ids): array { - $catrobat_root_descendant_relations = $this->getDescendantRelations($ancestor_program_ids); + $catrobat_root_descendant_relations = $this->getDescendantRelations($ancestor_project_ids); - return array_unique(array_map(fn (ProgramRemixRelation $relation) => $relation->getDescendantId(), $catrobat_root_descendant_relations)); + return array_unique(array_map(fn (ProjectRemixRelation $relation) => $relation->getDescendantId(), $catrobat_root_descendant_relations)); } - public function getDirectEdgeRelationsBetweenProgramIds(array $edge_start_program_ids, array $edge_end_program_ids): array + public function getDirectEdgeRelationsBetweenProjectIds(array $edge_start_project_ids, array $edge_end_project_ids): array { $qb = $this->createQueryBuilder('r'); return $qb ->select('r') - ->where('r.ancestor_id IN (:edge_start_program_ids)') - ->andWhere('r.descendant_id IN (:edge_end_program_ids)') + ->where('r.ancestor_id IN (:edge_start_project_ids)') + ->andWhere('r.descendant_id IN (:edge_end_project_ids)') ->andWhere($qb->expr()->eq('r.depth', $qb->expr()->literal(1))) - ->setParameter('edge_start_program_ids', $edge_start_program_ids) - ->setParameter('edge_end_program_ids', $edge_end_program_ids) + ->setParameter('edge_start_project_ids', $edge_start_project_ids) + ->setParameter('edge_end_project_ids', $edge_end_project_ids) ->distinct() ->getQuery() ->getResult() ; } - public function removeRelationsBetweenProgramIds(array $ancestor_program_ids, array $descendant_program_ids): void + public function removeRelationsBetweenProjectIds(array $ancestor_project_ids, array $descendant_project_ids): void { $qb = $this->createQueryBuilder('r'); $qb ->delete() - ->where('r.ancestor_id IN (:ancestor_program_ids)') - ->andWhere('r.descendant_id IN (:descendant_program_ids)') - ->setParameter('ancestor_program_ids', $ancestor_program_ids) - ->setParameter('descendant_program_ids', $descendant_program_ids) + ->where('r.ancestor_id IN (:ancestor_project_ids)') + ->andWhere('r.descendant_id IN (:descendant_project_ids)') + ->setParameter('ancestor_project_ids', $ancestor_project_ids) + ->setParameter('descendant_project_ids', $descendant_project_ids) ->getQuery() ->execute() ; @@ -162,7 +162,7 @@ public function removeAllRelations(): void } /** - * @return ProgramRemixRelation[] + * @return ProjectRemixRelation[] */ public function getUnseenDirectDescendantRelationsOfUser(User $user): array { @@ -197,15 +197,15 @@ public function markAllUnseenRelationsAsSeen(\DateTime $seen_at): void ; } - public function remixCount(string $program_id): int + public function remixCount(string $project_id): int { $qb = $this->createQueryBuilder('r'); $result = $qb ->select('r') - ->where($qb->expr()->eq('r.ancestor_id', ':program_id')) + ->where($qb->expr()->eq('r.ancestor_id', ':project_id')) ->andWhere($qb->expr()->eq('r.depth', $qb->expr()->literal(1))) - ->setParameter('program_id', $program_id) + ->setParameter('project_id', $project_id) ->distinct() ->getQuery() ->getResult() @@ -215,7 +215,7 @@ public function remixCount(string $program_id): int } /** - * @return ProgramRemixRelation[] + * @return ProjectRemixRelation[] */ public function getDirectParentRelationDataOfUser(string $user_id): array { @@ -234,9 +234,9 @@ public function getDirectParentRelationDataOfUser(string $user_id): array } /** - * @return ProgramRemixRelation[] + * @return ProjectRemixRelation[] */ - public function getDirectParentRelationsOfUsersRemixes(array $user_ids, string $exclude_user_id, array $exclude_program_ids, string $flavor): array + public function getDirectParentRelationsOfUsersRemixes(array $user_ids, string $exclude_user_id, array $exclude_project_ids, string $flavor): array { $qb = $this->createQueryBuilder('r'); @@ -247,13 +247,13 @@ public function getDirectParentRelationsOfUsersRemixes(array $user_ids, string $ ->where($qb->expr()->in('IDENTITY(pd.user)', ':user_ids')) ->andWhere($qb->expr()->neq('IDENTITY(pa.user)', ':exclude_user_id')) ->andWhere($qb->expr()->eq('r.depth', $qb->expr()->literal(1))) - ->andWhere($qb->expr()->notIn('r.ancestor_id', ':exclude_program_ids')) + ->andWhere($qb->expr()->notIn('r.ancestor_id', ':exclude_project_ids')) ->andWhere($qb->expr()->eq('pa.visible', $qb->expr()->literal(true))) ->andWhere($qb->expr()->eq('pa.flavor', ':flavor')) ->andWhere($qb->expr()->eq('pa.private', $qb->expr()->literal(false))) ->setParameter('user_ids', $user_ids) ->setParameter('exclude_user_id', $exclude_user_id) - ->setParameter('exclude_program_ids', $exclude_program_ids) + ->setParameter('exclude_project_ids', $exclude_project_ids) ->setParameter('flavor', $flavor) ->distinct() ->getQuery() diff --git a/src/DB/EntityRepository/Project/ProgramRepository.php b/src/DB/EntityRepository/Project/ProjectRepository.php similarity index 90% rename from src/DB/EntityRepository/Project/ProgramRepository.php rename to src/DB/EntityRepository/Project/ProjectRepository.php index 884c21ba0a..0549cf314f 100644 --- a/src/DB/EntityRepository/Project/ProgramRepository.php +++ b/src/DB/EntityRepository/Project/ProjectRepository.php @@ -3,9 +3,9 @@ namespace App\DB\EntityRepository\Project; use App\Admin\Tools\FeatureFlag\FeatureFlagManager; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\ProgramLike; -use App\DB\Entity\Project\Scratch\ScratchProgramRemixRelation; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\ProjectLike; +use App\DB\Entity\Project\Scratch\ScratchProjectRemixRelation; use App\Utils\RequestHelper; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\ORM\NonUniqueResultException; @@ -18,18 +18,18 @@ use Elastica\Query\MatchQuery; use FOS\ElasticaBundle\Finder\TransformedFinder; -class ProgramRepository extends ServiceEntityRepository +class ProjectRepository extends ServiceEntityRepository { - public function __construct(ManagerRegistry $managerRegistry, protected RequestHelper $app_request, protected FeatureFlagManager $feature_flag_manager, private readonly TransformedFinder $program_finder) + public function __construct(ManagerRegistry $managerRegistry, protected RequestHelper $app_request, protected FeatureFlagManager $feature_flag_manager, private readonly TransformedFinder $project_finder) { - parent::__construct($managerRegistry, Program::class); + parent::__construct($managerRegistry, Project::class); } - public function getProjectByID(string $program_id, bool $include_private = false): array + public function getProjectByID(string $project_id, bool $include_private = false): array { $query_builder = $this->createQueryBuilder('e'); $query_builder - ->where($query_builder->expr()->eq('e.id', $query_builder->expr()->literal($program_id))) + ->where($query_builder->expr()->eq('e.id', $query_builder->expr()->literal($project_id))) ; $query_builder = $this->excludeInvisibleProjects($query_builder); @@ -49,7 +49,7 @@ public function getProjects(string $flavor = null, string $max_version = '', int $this->excludeUnavailableAndPrivateProjectsElastica($bool_query, $flavor, $max_version); $query = $this->buildElasticaQuery($bool_query, $order_by, $order); - return $this->program_finder->find($query, $limit, ['from' => $offset]); + return $this->project_finder->find($query, $limit, ['from' => $offset]); } $query_builder = $this->createQueryAllBuilder(); $query_builder = $this->excludeUnavailableAndPrivateProjects($query_builder, $flavor, $max_version); @@ -80,7 +80,7 @@ public function getTrendingProjects(string $flavor = null, string $max_version = $bool_query->addMust($should_query); $query = $this->buildElasticaQuery($bool_query, $order_by, $order); - return $this->program_finder->find($query, $limit, ['from' => $offset]); + return $this->project_finder->find($query, $limit, ['from' => $offset]); } $query_builder = $this->createQueryAllBuilder(); $query_builder = $this->excludeUnavailableAndPrivateProjects($query_builder, $flavor, $max_version); @@ -101,7 +101,7 @@ public function getScratchRemixProjects(string $flavor = null, string $max_versi $qb = $this->setPagination($qb, $limit, $offset); $qb = $this->setOrderBy($qb, 'views'); $qb - ->innerJoin(ScratchProgramRemixRelation::class, 'rp') + ->innerJoin(ScratchProjectRemixRelation::class, 'rp') ->andWhere($qb->expr()->eq('e.id', 'rp.catrobat_child')) ; @@ -113,7 +113,7 @@ public function countScratchRemixProjects(string $flavor = null, string $max_ver $qb = $this->createQueryCountBuilder(); $qb = $this->excludeUnavailableAndPrivateProjects($qb, $flavor, $max_version); $qb - ->innerJoin(ScratchProgramRemixRelation::class, 'rp') + ->innerJoin(ScratchProjectRemixRelation::class, 'rp') ->where($qb->expr()->eq('e.id', 'rp.catrobat_child')) ; @@ -249,21 +249,21 @@ public function getMoreProjectsFromUser(string $user_id, string $project_id, str // /** - * @param string[] $program_ids + * @param string[] $project_ids * * @return string[] * * @internal * ATTENTION! Internal use only! (no visible/private/debug check) */ - public function filterExistingProgramIds(array $program_ids): array + public function filterExistingProjectIds(array $project_ids): array { $query_builder = $this->createQueryBuilder('p'); $result = $query_builder ->select(['p.id']) - ->where('p.id IN (:program_ids)') - ->setParameter('program_ids', $program_ids) + ->where('p.id IN (:project_ids)') + ->setParameter('project_ids', $project_ids) ->distinct() ->getQuery() ->getResult() @@ -296,45 +296,45 @@ public function markAllProjectsAsNotYetMigrated(): void * @internal * ATTENTION! Internal use only! (no visible/private/debug check) */ - public function findNext(string $previous_program_id): mixed + public function findNext(string $previous_project_id): mixed { $query_builder = $this->createQueryBuilder('p'); return $query_builder ->select('min(p.id)') - ->where($query_builder->expr()->gt('p.id', ':previous_program_id')) - ->setParameter('previous_program_id', $previous_program_id) + ->where($query_builder->expr()->gt('p.id', ':previous_project_id')) + ->setParameter('previous_project_id', $previous_project_id) ->distinct() ->getQuery() ->getSingleScalarResult() ; } - public function getProjectDataByIds(array $program_ids): array + public function getProjectDataByIds(array $project_ids): array { $query_builder = $this->createQueryBuilder('e'); $query_builder = $this->excludeUnavailableAndPrivateProjects($query_builder); $query_builder ->select(['e.id', 'e.name', 'e.uploaded_at', 'u.username']) ->innerJoin('e.user', 'u') - ->andWhere('e.id IN (:program_ids)') - ->setParameter('program_ids', $program_ids) + ->andWhere('e.id IN (:project_ids)') + ->setParameter('project_ids', $project_ids) ->distinct() ; return $query_builder->getQuery()->getResult(); } - public function getMostLikedPrograms(?string $flavor, string $max_version, int $limit = 0, int $offset = 0): array + public function getMostLikedProjects(?string $flavor, string $max_version, int $limit = 0, int $offset = 0): array { $query_builder = $this->createQueryBuilder('e'); $query_builder = $this->excludeUnavailableAndPrivateProjects($query_builder, $flavor, $max_version); $query_builder = $this->setPagination($query_builder, $limit, $offset); $query_builder - ->select(['e as program', 'COUNT(e.id) as like_count']) - ->innerJoin(ProgramLike::class, 'l', Join::WITH, - $query_builder->expr()->eq('e.id', 'l.program_id')->__toString()) + ->select(['e as project', 'COUNT(e.id) as like_count']) + ->innerJoin(ProjectLike::class, 'l', Join::WITH, + $query_builder->expr()->eq('e.id', 'l.project_id')->__toString()) ->having($query_builder->expr()->gt('like_count', $query_builder->expr()->literal(1))) ->groupBy('e.id') ->orderBy('like_count', 'DESC') @@ -343,32 +343,32 @@ public function getMostLikedPrograms(?string $flavor, string $max_version, int $ $results = $query_builder->getQuery()->getResult(); - return array_map(fn ($result) => $result['program'], $results); + return array_map(fn ($result) => $result['project'], $results); } - public function getOtherMostDownloadedProjectsOfUsersThatAlsoDownloadedGivenProject(string $flavor, Program $program, ?int $limit, int $offset): array + public function getOtherMostDownloadedProjectsOfUsersThatAlsoDownloadedGivenProject(string $flavor, Project $project, ?int $limit, int $offset): array { return []; // disabled } - public function filterVisiblePrograms(array $programs, string $max_version = ''): array + public function filterVisibleProjects(array $projects, string $max_version = ''): array { - if (empty($programs)) { + if (empty($projects)) { return []; } - /** @var Program[] $filtered_programs */ - $filtered_programs = []; + /** @var Project[] $filtered_projects */ + $filtered_projects = []; - foreach ($programs as $program) { - if (true === $program->getVisible() && false === $program->getPrivate() - && ($this->app_request->isDebugBuildRequest() || false === $program->isDebugBuild()) - && ('' === $max_version || $program->getLanguageVersion() <= $max_version)) { - $filtered_programs[] = $program; + foreach ($projects as $project) { + if (true === $project->getVisible() && false === $project->getPrivate() + && ($this->app_request->isDebugBuildRequest() || false === $project->isDebugBuild()) + && ('' === $max_version || $project->getLanguageVersion() <= $max_version)) { + $filtered_projects[] = $project; } } - return $filtered_programs; + return $filtered_projects; } // diff --git a/src/DB/EntityRepository/Project/ScratchProgramRemixRepository.php b/src/DB/EntityRepository/Project/ScratchProgramRemixRepository.php deleted file mode 100644 index f7505ea8f9..0000000000 --- a/src/DB/EntityRepository/Project/ScratchProgramRemixRepository.php +++ /dev/null @@ -1,61 +0,0 @@ -createQueryBuilder('s'); - - return $qb - ->select('s') - ->where('s.catrobat_child_id IN (:program_ids)') - ->setParameter('program_ids', $program_ids) - ->distinct() - ->getQuery() - ->getResult() - ; - } - - /** - * @param string[] $scratch_parent_program_ids - */ - public function removeParentRelations(string $program_id, array $scratch_parent_program_ids): void - { - $qb = $this->createQueryBuilder('s'); - - $qb - ->delete() - ->where('s.scratch_parent_id IN (:scratch_parent_program_ids)') - ->andWhere($qb->expr()->eq('s.catrobat_child_id', ':program_id')) - ->setParameter('scratch_parent_program_ids', $scratch_parent_program_ids) - ->setParameter('program_id', $program_id) - ->getQuery() - ->execute() - ; - } - - public function removeAllRelations(): void - { - $qb = $this->createQueryBuilder('s'); - - $qb - ->delete() - ->getQuery() - ->execute() - ; - } -} diff --git a/src/DB/EntityRepository/Project/ScratchProjectRemixRepository.php b/src/DB/EntityRepository/Project/ScratchProjectRemixRepository.php new file mode 100644 index 0000000000..795a084768 --- /dev/null +++ b/src/DB/EntityRepository/Project/ScratchProjectRemixRepository.php @@ -0,0 +1,61 @@ +createQueryBuilder('s'); + + return $qb + ->select('s') + ->where('s.catrobat_child_id IN (:project_ids)') + ->setParameter('project_ids', $project_ids) + ->distinct() + ->getQuery() + ->getResult() + ; + } + + /** + * @param string[] $scratch_parent_project_ids + */ + public function removeParentRelations(string $project_id, array $scratch_parent_project_ids): void + { + $qb = $this->createQueryBuilder('s'); + + $qb + ->delete() + ->where('s.scratch_parent_id IN (:scratch_parent_project_ids)') + ->andWhere($qb->expr()->eq('s.catrobat_child_id', ':project_id')) + ->setParameter('scratch_parent_project_ids', $scratch_parent_project_ids) + ->setParameter('project_id', $project_id) + ->getQuery() + ->execute() + ; + } + + public function removeAllRelations(): void + { + $qb = $this->createQueryBuilder('s'); + + $qb + ->delete() + ->getQuery() + ->execute() + ; + } +} diff --git a/src/DB/EntityRepository/Project/ScratchProgramRepository.php b/src/DB/EntityRepository/Project/ScratchProjectRepository.php similarity index 53% rename from src/DB/EntityRepository/Project/ScratchProgramRepository.php rename to src/DB/EntityRepository/Project/ScratchProjectRepository.php index 2305978589..962ddfe40d 100644 --- a/src/DB/EntityRepository/Project/ScratchProgramRepository.php +++ b/src/DB/EntityRepository/Project/ScratchProjectRepository.php @@ -2,28 +2,28 @@ namespace App\DB\EntityRepository\Project; -use App\DB\Entity\Project\Scratch\ScratchProgram; +use App\DB\Entity\Project\Scratch\ScratchProject; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; -class ScratchProgramRepository extends ServiceEntityRepository +class ScratchProjectRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $managerRegistry) { - parent::__construct($managerRegistry, ScratchProgram::class); + parent::__construct($managerRegistry, ScratchProject::class); } /** - * @param string[] $scratch_program_ids + * @param string[] $scratch_project_ids */ - public function getProgramDataByIds(array $scratch_program_ids): array + public function getProjectDataByIds(array $scratch_project_ids): array { $qb = $this->createQueryBuilder('s'); return $qb ->select(['s.id', 's.name', 's.username']) - ->where('s.id IN (:scratch_program_ids)') - ->setParameter('scratch_program_ids', $scratch_program_ids) + ->where('s.id IN (:scratch_project_ids)') + ->setParameter('scratch_project_ids', $scratch_project_ids) ->distinct() ->getQuery() ->getResult() diff --git a/src/DB/EntityRepository/Project/Special/ExampleRepository.php b/src/DB/EntityRepository/Project/Special/ExampleRepository.php index f31edfcd86..e7cec0f772 100644 --- a/src/DB/EntityRepository/Project/Special/ExampleRepository.php +++ b/src/DB/EntityRepository/Project/Special/ExampleRepository.php @@ -2,8 +2,8 @@ namespace App\DB\EntityRepository\Project\Special; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\Special\ExampleProgram; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\Special\ExampleProject; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\NoResultException; @@ -15,11 +15,11 @@ class ExampleRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $managerRegistry) { - parent::__construct($managerRegistry, ExampleProgram::class); + parent::__construct($managerRegistry, ExampleProject::class); } /** - * @return Program[] + * @return Project[] */ public function getExampleProjects(bool $debug_build, ?string $flavor, ?int $limit = 20, ?int $offset = 0, string $platform = null, string $max_version = null): array { @@ -28,12 +28,12 @@ public function getExampleProjects(bool $debug_build, ?string $flavor, ?int $lim $qb ->select('e') ->where('e.active = true') - ->andWhere($qb->expr()->isNotNull('e.program')) + ->andWhere($qb->expr()->isNotNull('e.project')) ->setFirstResult($offset) ->setMaxResults($limit) ; $qb->orderBy('e.priority', 'DESC'); - $qb->leftJoin('e.program', 'program'); + $qb->leftJoin('e.project', 'project'); $qb = $this->addMaxVersionCondition($qb, $max_version); $qb = $this->addFeaturedExampleFlavorCondition($qb, $flavor); @@ -47,10 +47,10 @@ public function getExampleProjectsCount(bool $debug_build, ?string $flavor, stri $qb ->select('count(e.id)') ->where('e.active = true') - ->andWhere($qb->expr()->isNotNull('e.program')) + ->andWhere($qb->expr()->isNotNull('e.project')) ; $qb->orderBy('e.priority', 'DESC'); - $qb->leftJoin('e.program', 'program'); + $qb->leftJoin('e.project', 'project'); $qb = $this->addMaxVersionCondition($qb, $max_version); $qb = $this->addFeaturedExampleFlavorCondition($qb, $flavor); @@ -67,7 +67,7 @@ public function getExampleProjectsCount(bool $debug_build, ?string $flavor, stri * @throws NoResultException * @throws NonUniqueResultException */ - public function getExampleProgramCount(string $flavor, bool $for_ios = false): mixed + public function getExampleProjectCount(string $flavor, bool $for_ios = false): mixed { $qb = $this->createQueryBuilder('e'); @@ -76,7 +76,7 @@ public function getExampleProgramCount(string $flavor, bool $for_ios = false): m ->join('e.flavor', 'fl') ->where('e.active = true') ->andWhere($qb->expr()->eq('fl.name', ':flavor')) - ->andWhere($qb->expr()->isNotNull('e.program')) + ->andWhere($qb->expr()->isNotNull('e.project')) ->andWhere($qb->expr()->eq('e.for_ios', ':for_ios')) ->setParameter('flavor', $flavor) ->setParameter('for_ios', $for_ios) @@ -125,13 +125,13 @@ public function getExampleItemCount(string $flavor): mixed /** * @throws NoResultException */ - public function isExample(Program $program): bool + public function isExample(Project $project): bool { $qb = $this->createQueryBuilder('e'); $qb ->select('count(e.id)') - ->where($qb->expr()->eq('e.program', ':program')) - ->setParameter('program', $program) + ->where($qb->expr()->eq('e.project', ':project')) + ->setParameter('project', $project) ; try { $count = $qb->getQuery()->getSingleScalarResult(); @@ -163,8 +163,8 @@ private function addMaxVersionCondition(QueryBuilder $query_builder, string $max { if (null !== $max_version && '' !== $max_version) { $query_builder - ->innerJoin(Program::class, 'p', Join::WITH, - $query_builder->expr()->eq('e.program', 'p')->__toString()) + ->innerJoin(Project::class, 'p', Join::WITH, + $query_builder->expr()->eq('e.project', 'p')->__toString()) ->andWhere($query_builder->expr()->lte('p.language_version', ':max_version')) ->setParameter('max_version', $max_version) ->addOrderBy('e.id', 'ASC') diff --git a/src/DB/EntityRepository/Project/Special/FeaturedRepository.php b/src/DB/EntityRepository/Project/Special/FeaturedRepository.php index 7befd4e378..f173afdb07 100644 --- a/src/DB/EntityRepository/Project/Special/FeaturedRepository.php +++ b/src/DB/EntityRepository/Project/Special/FeaturedRepository.php @@ -2,8 +2,8 @@ namespace App\DB\EntityRepository\Project\Special; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\Special\FeaturedProgram; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\Special\FeaturedProject; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\NoResultException; @@ -15,22 +15,22 @@ class FeaturedRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $managerRegistry) { - parent::__construct($managerRegistry, FeaturedProgram::class); + parent::__construct($managerRegistry, FeaturedProject::class); } - public function getFeaturedPrograms(?string $flavor, ?int $limit = 20, ?int $offset = 0, string $platform = null, string $max_version = null): mixed + public function getFeaturedProjects(?string $flavor, ?int $limit = 20, ?int $offset = 0, string $platform = null, string $max_version = null): mixed { $qb = $this->createQueryBuilder('e'); $qb ->select('e') ->where('e.active = true') - ->andWhere($qb->expr()->isNotNull('e.program')) + ->andWhere($qb->expr()->isNotNull('e.project')) ->setFirstResult($offset) ->setMaxResults($limit) ; $qb->orderBy('e.priority', 'DESC'); - $qb->leftJoin('e.program', 'program'); + $qb->leftJoin('e.project', 'project'); $qb = $this->addMaxVersionCondition($qb, $max_version); $qb = $this->addFeaturedExampleFlavorCondition($qb, $flavor); $qb = $this->addPlatformCondition($qb, $platform); @@ -38,17 +38,17 @@ public function getFeaturedPrograms(?string $flavor, ?int $limit = 20, ?int $off return $qb->getQuery()->getResult(); } - public function getFeaturedProgramsCount(?string $flavor, string $platform = null, string $max_version = null): int + public function getFeaturedProjectsCount(?string $flavor, string $platform = null, string $max_version = null): int { $qb = $this->createQueryBuilder('e'); $qb ->select('count(e.id)') ->where('e.active = true') - ->andWhere($qb->expr()->isNotNull('e.program')) + ->andWhere($qb->expr()->isNotNull('e.project')) ; $qb->orderBy('e.priority', 'DESC'); - $qb->leftJoin('e.program', 'program'); + $qb->leftJoin('e.project', 'project'); $qb = $this->addMaxVersionCondition($qb, $max_version); $qb = $this->addFeaturedExampleFlavorCondition($qb, $flavor); $qb = $this->addPlatformCondition($qb, $platform); @@ -66,7 +66,7 @@ public function getFeaturedProgramsCount(?string $flavor, string $platform = nul * @throws NoResultException * @throws NonUniqueResultException */ - public function getFeaturedProgramCount(string $flavor, bool $for_ios = false): mixed + public function getFeaturedProjectCount(string $flavor, bool $for_ios = false): mixed { $qb = $this->createQueryBuilder('e'); @@ -75,7 +75,7 @@ public function getFeaturedProgramCount(string $flavor, bool $for_ios = false): ->join('e.flavor', 'fl') ->where('e.active = true') ->andWhere($qb->expr()->eq('fl.name', ':flavor')) - ->andWhere($qb->expr()->isNotNull('e.program')) + ->andWhere($qb->expr()->isNotNull('e.project')) ->andWhere($qb->expr()->eq('e.for_ios', ':for_ios')) ->setParameter('flavor', $flavor) ->setParameter('for_ios', $for_ios) @@ -121,13 +121,13 @@ public function getFeaturedItemCount(string $flavor): mixed ; } - public function isFeatured(Program $program): bool + public function isFeatured(Project $project): bool { $qb = $this->createQueryBuilder('e'); $qb ->select('count(e.id)') - ->where($qb->expr()->eq('e.program', ':program')) - ->setParameter('program', $program) + ->where($qb->expr()->eq('e.project', ':project')) + ->setParameter('project', $project) ; try { $count = intval($qb->getQuery()->getSingleScalarResult()); @@ -181,8 +181,8 @@ private function addMaxVersionCondition(QueryBuilder $query_builder, string $max } $query_builder - ->innerJoin(Program::class, 'p', Join::WITH, - $query_builder->expr()->eq('e.program', 'p')->__toString()) + ->innerJoin(Project::class, 'p', Join::WITH, + $query_builder->expr()->eq('e.project', 'p')->__toString()) ->andWhere($query_builder->expr()->lte('p.language_version', ':max_version')) ->setParameter('max_version', $max_version) ->addOrderBy('e.id', 'ASC') diff --git a/src/DB/EntityRepository/Studios/StudioProgramRepository.php b/src/DB/EntityRepository/Studios/StudioProjectRepository.php similarity index 67% rename from src/DB/EntityRepository/Studios/StudioProgramRepository.php rename to src/DB/EntityRepository/Studios/StudioProjectRepository.php index 9b8464e3bc..d8f5b268f7 100644 --- a/src/DB/EntityRepository/Studios/StudioProgramRepository.php +++ b/src/DB/EntityRepository/Studios/StudioProjectRepository.php @@ -2,18 +2,18 @@ namespace App\DB\EntityRepository\Studios; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\Studio\Studio; -use App\DB\Entity\Studio\StudioProgram; +use App\DB\Entity\Studio\StudioProject; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; use Symfony\Component\Security\Core\User\UserInterface; -class StudioProgramRepository extends ServiceEntityRepository +class StudioProjectRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $managerRegistry) { - parent::__construct($managerRegistry, StudioProgram::class); + parent::__construct($managerRegistry, StudioProject::class); } public function findAllStudioProjects(Studio $studio): array @@ -21,9 +21,9 @@ public function findAllStudioProjects(Studio $studio): array return $this->findBy(['studio' => $studio]); } - public function findStudioProject(Studio $studio, Program $program): ?StudioProgram + public function findStudioProject(Studio $studio, Project $project): ?StudioProject { - return $this->findOneBy(['studio' => $studio, 'program' => $program]); + return $this->findOneBy(['studio' => $studio, 'project' => $project]); } public function countStudioProjects(?Studio $studio): int diff --git a/src/DB/EntityRepository/Studios/StudioRepository.php b/src/DB/EntityRepository/Studios/StudioRepository.php index 8b69f33aeb..2c301fdeba 100644 --- a/src/DB/EntityRepository/Studios/StudioRepository.php +++ b/src/DB/EntityRepository/Studios/StudioRepository.php @@ -3,7 +3,7 @@ namespace App\DB\EntityRepository\Studios; use App\DB\Entity\Studio\Studio; -use App\DB\Entity\Studio\StudioProgram; +use App\DB\Entity\Studio\StudioProject; use App\DB\Entity\Studio\StudioUser; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; @@ -24,7 +24,7 @@ public function findAllStudiosWithUsersAndProjectsCount(): array ; $qb_sp = $this->getEntityManager()->createQueryBuilder(); $qb_sp->select('COUNT(sp)') - ->from(StudioProgram::class, 'sp') + ->from(StudioProject::class, 'sp') ->where('s.id = sp.studio') ; $qb = $this->getEntityManager()->createQueryBuilder(); diff --git a/src/DB/EntityRepository/Translation/ProjectCustomTranslationRepository.php b/src/DB/EntityRepository/Translation/ProjectCustomTranslationRepository.php index 46dab0908b..03affc51fd 100644 --- a/src/DB/EntityRepository/Translation/ProjectCustomTranslationRepository.php +++ b/src/DB/EntityRepository/Translation/ProjectCustomTranslationRepository.php @@ -2,7 +2,7 @@ namespace App\DB\EntityRepository\Translation; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\Translation\ProjectCustomTranslation; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; @@ -14,7 +14,7 @@ public function __construct(ManagerRegistry $manager_registry) parent::__construct($manager_registry, ProjectCustomTranslation::class); } - public function addNameTranslation(Program $project, string $language, string $name_translation): bool + public function addNameTranslation(Project $project, string $language, string $name_translation): bool { $entry_count = $this->count($this->getCriteria($project, $language)); @@ -41,7 +41,7 @@ public function addNameTranslation(Program $project, string $language, string $n return true; } - public function addDescriptionTranslation(Program $project, string $language, string $description_translation): bool + public function addDescriptionTranslation(Project $project, string $language, string $description_translation): bool { $entry_count = $this->count($this->getCriteria($project, $language)); @@ -68,7 +68,7 @@ public function addDescriptionTranslation(Program $project, string $language, st return true; } - public function addCreditTranslation(Program $project, string $language, string $credit_translation): bool + public function addCreditTranslation(Project $project, string $language, string $credit_translation): bool { $entry_count = $this->count($this->getCriteria($project, $language)); @@ -95,28 +95,28 @@ public function addCreditTranslation(Program $project, string $language, string return true; } - public function getNameTranslation(Program $project, string $language): ?string + public function getNameTranslation(Project $project, string $language): ?string { $translation = $this->findTranslation($project, $language); return null === $translation ? null : $translation->getName(); } - public function getDescriptionTranslation(Program $project, string $language): ?string + public function getDescriptionTranslation(Project $project, string $language): ?string { $translation = $this->findTranslation($project, $language); return null === $translation ? null : $translation->getDescription(); } - public function getCreditTranslation(Program $project, string $language): ?string + public function getCreditTranslation(Project $project, string $language): ?string { $translation = $this->findTranslation($project, $language); return null === $translation ? null : $translation->getCredits(); } - public function deleteNameTranslation(Program $project, string $language): bool + public function deleteNameTranslation(Project $project, string $language): bool { $translation = $this->findTranslation($project, $language); @@ -135,7 +135,7 @@ public function deleteNameTranslation(Program $project, string $language): bool return true; } - public function deleteDescriptionTranslation(Program $project, string $language): bool + public function deleteDescriptionTranslation(Project $project, string $language): bool { $translation = $this->findTranslation($project, $language); @@ -154,7 +154,7 @@ public function deleteDescriptionTranslation(Program $project, string $language) return true; } - public function deleteCreditTranslation(Program $project, string $language): bool + public function deleteCreditTranslation(Project $project, string $language): bool { $translation = $this->findTranslation($project, $language); @@ -173,7 +173,7 @@ public function deleteCreditTranslation(Program $project, string $language): boo return true; } - public function listDefinedLanguages(Program $project): array + public function listDefinedLanguages(Project $project): array { $qb = $this->createQueryBuilder('t'); @@ -190,7 +190,7 @@ public function listDefinedLanguages(Program $project): array } /** - * @psalm-param array $projects + * @psalm-param array $projects */ public function countDefinedLanguages(array $projects): int { @@ -202,12 +202,12 @@ public function countDefinedLanguages(array $projects): int return sizeof($languages); } - private function findTranslation(Program $project, string $language): ?ProjectCustomTranslation + private function findTranslation(Project $project, string $language): ?ProjectCustomTranslation { return $this->findOneBy($this->getCriteria($project, $language)); } - private function getCriteria(Program $project, string $language): array + private function getCriteria(Project $project, string $language): array { return ['project' => $project, 'language' => $language]; } diff --git a/src/DB/EntityRepository/Translation/ProjectMachineTranslationRepository.php b/src/DB/EntityRepository/Translation/ProjectMachineTranslationRepository.php index 1c9d36c498..c94efdbc78 100644 --- a/src/DB/EntityRepository/Translation/ProjectMachineTranslationRepository.php +++ b/src/DB/EntityRepository/Translation/ProjectMachineTranslationRepository.php @@ -2,7 +2,7 @@ namespace App\DB\EntityRepository\Translation; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\Translation\ProjectMachineTranslation; use App\Translation\TranslationResult; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; @@ -16,7 +16,7 @@ public function __construct(ManagerRegistry $managerRegistry) parent::__construct($managerRegistry, ProjectMachineTranslation::class); } - public function getCachedTranslation(Program $project, ?string $source_language, string $target_language): ?array + public function getCachedTranslation(Project $project, ?string $source_language, string $target_language): ?array { $criteria = Criteria::create() ->where(Criteria::expr()->eq('project', $project)) @@ -63,7 +63,7 @@ public function getCachedTranslation(Program $project, ?string $source_language, return $result; } - public function invalidateCachedTranslation(Program $project): void + public function invalidateCachedTranslation(Project $project): void { /** @var ProjectMachineTranslation[] $entries */ $entries = $this->findBy(['project' => $project]); diff --git a/src/DB/EntityRepository/User/Comment/UserCommentRepository.php b/src/DB/EntityRepository/User/Comment/UserCommentRepository.php index ae38ab95cf..e92473e51d 100644 --- a/src/DB/EntityRepository/User/Comment/UserCommentRepository.php +++ b/src/DB/EntityRepository/User/Comment/UserCommentRepository.php @@ -2,7 +2,7 @@ namespace App\DB\EntityRepository\User\Comment; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\Studio\Studio; use App\DB\Entity\User\Comment\UserComment; use App\DB\Entity\User\User; @@ -56,13 +56,13 @@ public function countCommentReplies(int $comment_id): int return $this->count(['parent_id' => $comment_id]); } - public function findCommentsByProgramId(string $program_id): array + public function findCommentsByProjectId(string $project_id): array { $qb = $this->createQueryBuilder('uc'); return $qb->select('uc') - ->where('uc.program = :program_id') - ->setParameter('program_id', $program_id) + ->where('uc.project = :project_id') + ->setParameter('project_id', $project_id) ->andWhere($qb->expr()->orX()->addMultiple([ $qb->expr()->isNull('uc.parent_id'), $qb->expr()->eq('uc.parent_id', 0), @@ -84,7 +84,7 @@ public function findCommentRepliesByParentId(string $parent_id): array ; } - public function getProjectCommentOverviewListData(Program $project): array + public function getProjectCommentOverviewListData(Project $project): array { return $this->createQueryBuilder('c') ->innerJoin('c.user', 'cu') @@ -97,9 +97,9 @@ public function getProjectCommentOverviewListData(Program $project): array 'cu.id as user_id', 'cu.avatar as user_avatar', '(SELECT COUNT(c2.id) FROM '.UserComment::class.' c2 WHERE c2.parent_id = c.id) AS number_of_replies') - ->where('c.program = :program') + ->where('c.project = :project') ->andWhere('c.parent_id IS NULL') - ->setParameter('program', $project) + ->setParameter('project', $project) ->getQuery() ->getResult() ; @@ -112,14 +112,14 @@ public function getProjectCommentDetailViewData(string $comment_id): array { return $this->createQueryBuilder('c') ->innerJoin('c.user', 'cu') - ->innerJoin('c.program', 'cp') + ->innerJoin('c.project', 'cp') ->select( 'c.id', 'c.username', 'c.text', 'c.is_deleted', 'c.uploadDate as upload_date', - 'cp.id as program_id', + 'cp.id as project_id', 'cu.id as user_id', 'cu.avatar as user_avatar' ) diff --git a/src/DB/EntityRepository/User/Notification/NotificationRepository.php b/src/DB/EntityRepository/User/Notification/NotificationRepository.php index 7f12653838..d07d1430eb 100644 --- a/src/DB/EntityRepository/User/Notification/NotificationRepository.php +++ b/src/DB/EntityRepository/User/Notification/NotificationRepository.php @@ -2,7 +2,7 @@ namespace App\DB\EntityRepository\User\Notification; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\Notifications\CatroNotification; use App\DB\Entity\User\Notifications\FollowNotification; use App\DB\Entity\User\Notifications\LikeNotification; @@ -20,15 +20,15 @@ public function __construct(ManagerRegistry $managerRegistry) /** * @return LikeNotification[] */ - public function getLikeNotificationsForProject(Program $project, User $owner = null, User $likeFrom = null): array + public function getLikeNotificationsForProject(Project $project, User $owner = null, User $likeFrom = null): array { $qb = $this->_em->createQueryBuilder(); $qb ->select('n') ->from(LikeNotification::class, 'n') - ->where($qb->expr()->eq('n.program', ':program_id')) - ->setParameter(':program_id', $project->getId()) + ->where($qb->expr()->eq('n.project', ':project_id')) + ->setParameter(':project_id', $project->getId()) ; if (null !== $owner) { diff --git a/src/Project/Apk/ApkCleanupEventSubscriber.php b/src/Project/Apk/ApkCleanupEventSubscriber.php index a22b620c91..d735a6101b 100644 --- a/src/Project/Apk/ApkCleanupEventSubscriber.php +++ b/src/Project/Apk/ApkCleanupEventSubscriber.php @@ -2,7 +2,7 @@ namespace App\Project\Apk; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Project\Event\ProjectBeforePersistEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -17,7 +17,7 @@ public function handleEvent(ProjectBeforePersistEvent $event): void $project = $event->getProjectEntity(); if (null !== $project->getId()) { $this->repository->remove($project->getId()); - $project->setApkStatus(Program::APK_NONE); + $project->setApkStatus(Project::APK_NONE); } } diff --git a/src/Project/CatrobatFile/ExtractedCatrobatFile.php b/src/Project/CatrobatFile/ExtractedCatrobatFile.php index 81762f85b4..87cb4c55d2 100644 --- a/src/Project/CatrobatFile/ExtractedCatrobatFile.php +++ b/src/Project/CatrobatFile/ExtractedCatrobatFile.php @@ -2,7 +2,7 @@ namespace App\Project\CatrobatFile; -use App\DB\EntityRepository\Project\ProgramRepository; +use App\DB\EntityRepository\Project\ProjectRepository; use App\Project\CatrobatCode\CodeObject; use App\Project\CatrobatCode\StatementFactory; use App\Project\Remix\RemixData; @@ -251,7 +251,7 @@ public function saveProjectXmlProperties(): void /** * based on: http://stackoverflow.com/a/27295688. */ - public function getRemixesData(string $project_id, bool $is_initial_version, ProgramRepository $project_repository, bool $migration_mode = false): array + public function getRemixesData(string $project_id, bool $is_initial_version, ProjectRepository $project_repository, bool $migration_mode = false): array { $remixes_string = $migration_mode ? $this->getRemixMigrationUrlsString() : $this->getRemixUrlsString(); $state = RemixUrlParsingState::STARTING; diff --git a/src/Project/CatrobatFile/ExtractedFileRepository.php b/src/Project/CatrobatFile/ExtractedFileRepository.php index 0f085a4b70..62a476df22 100644 --- a/src/Project/CatrobatFile/ExtractedFileRepository.php +++ b/src/Project/CatrobatFile/ExtractedFileRepository.php @@ -2,7 +2,7 @@ namespace App\Project\CatrobatFile; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Project\ProjectManager; use App\Storage\FileHelper; use Psr\Log\LoggerInterface; @@ -34,7 +34,7 @@ public function getBaseDir(string $id): string return $this->local_path.$id.'/'; } - public function loadProjectExtractedFile(Program $project): ?ExtractedCatrobatFile + public function loadProjectExtractedFile(Project $project): ?ExtractedCatrobatFile { try { $project_id = $project->getId(); @@ -45,7 +45,7 @@ public function loadProjectExtractedFile(Program $project): ?ExtractedCatrobatFi } } - public function removeProjectExtractedFile(Program $project): void + public function removeProjectExtractedFile(Project $project): void { try { $project_id = $project->getId(); diff --git a/src/Project/CatrobatFile/ProjectFlavorEventSubscriber.php b/src/Project/CatrobatFile/ProjectFlavorEventSubscriber.php index 602de6f58d..6b063ce083 100644 --- a/src/Project/CatrobatFile/ProjectFlavorEventSubscriber.php +++ b/src/Project/CatrobatFile/ProjectFlavorEventSubscriber.php @@ -2,7 +2,7 @@ namespace App\Project\CatrobatFile; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Project\Event\ProjectBeforePersistEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\RequestStack; @@ -18,7 +18,7 @@ public function onEvent(ProjectBeforePersistEvent $event): void $this->checkFlavor($event->getProjectEntity()); } - public function checkFlavor(Program $project): void + public function checkFlavor(Project $project): void { $request = $this->request_stack->getCurrentRequest(); if (null == $request) { diff --git a/src/Project/Event/ProjectAfterInsertEvent.php b/src/Project/Event/ProjectAfterInsertEvent.php index f9d0b09433..d8f81fbaa2 100644 --- a/src/Project/Event/ProjectAfterInsertEvent.php +++ b/src/Project/Event/ProjectAfterInsertEvent.php @@ -2,13 +2,13 @@ namespace App\Project\Event; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Project\CatrobatFile\ExtractedCatrobatFile; use Symfony\Contracts\EventDispatcher\Event; class ProjectAfterInsertEvent extends Event { - public function __construct(protected ExtractedCatrobatFile $extracted_file, protected Program $project) + public function __construct(protected ExtractedCatrobatFile $extracted_file, protected Project $project) { } @@ -17,7 +17,7 @@ public function getExtractedFile(): ExtractedCatrobatFile return $this->extracted_file; } - public function getProjectEntity(): Program + public function getProjectEntity(): Project { return $this->project; } diff --git a/src/Project/Event/ProjectBeforePersistEvent.php b/src/Project/Event/ProjectBeforePersistEvent.php index f9f6ed39c8..4d80f303c9 100644 --- a/src/Project/Event/ProjectBeforePersistEvent.php +++ b/src/Project/Event/ProjectBeforePersistEvent.php @@ -2,13 +2,13 @@ namespace App\Project\Event; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Project\CatrobatFile\ExtractedCatrobatFile; use Symfony\Contracts\EventDispatcher\Event; class ProjectBeforePersistEvent extends Event { - public function __construct(protected ExtractedCatrobatFile $extracted_file, protected Program $project) + public function __construct(protected ExtractedCatrobatFile $extracted_file, protected Project $project) { } @@ -17,7 +17,7 @@ public function getExtractedFile(): ExtractedCatrobatFile return $this->extracted_file; } - public function getProjectEntity(): Program + public function getProjectEntity(): Project { return $this->project; } diff --git a/src/Project/Event/ProjectDownloadEvent.php b/src/Project/Event/ProjectDownloadEvent.php index b5a20171f1..27e997a8b5 100644 --- a/src/Project/Event/ProjectDownloadEvent.php +++ b/src/Project/Event/ProjectDownloadEvent.php @@ -2,7 +2,7 @@ namespace App\Project\Event; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; use Symfony\Component\HttpFoundation\Request; use Symfony\Contracts\EventDispatcher\Event; @@ -11,7 +11,7 @@ class ProjectDownloadEvent extends Event { protected Request $request; - public function __construct(protected ?User $user, protected Program $project, protected string $download_type) + public function __construct(protected ?User $user, protected Project $project, protected string $download_type) { } @@ -20,7 +20,7 @@ public function getUser(): ?User return $this->user; } - public function getProject(): Program + public function getProject(): Project { return $this->project; } diff --git a/src/Project/Event/ReportInsertEvent.php b/src/Project/Event/ReportInsertEvent.php index d535f9299c..e81c5a51a2 100644 --- a/src/Project/Event/ReportInsertEvent.php +++ b/src/Project/Event/ReportInsertEvent.php @@ -2,12 +2,12 @@ namespace App\Project\Event; -use App\DB\Entity\Project\ProgramInappropriateReport; +use App\DB\Entity\Project\ProjectInappropriateReport; use Symfony\Contracts\EventDispatcher\Event; class ReportInsertEvent extends Event { - public function __construct(protected ?string $category, protected ?string $note, protected ProgramInappropriateReport $project) + public function __construct(protected ?string $category, protected ?string $note, protected ProjectInappropriateReport $project) { } @@ -21,7 +21,7 @@ public function getNote(): ?string return $this->note; } - public function getReport(): ProgramInappropriateReport + public function getReport(): ProjectInappropriateReport { return $this->project; } diff --git a/src/Project/EventListener/ExampleProjectImageListener.php b/src/Project/EventListener/ExampleProjectImageListener.php index 0e56b51444..d26537753a 100644 --- a/src/Project/EventListener/ExampleProjectImageListener.php +++ b/src/Project/EventListener/ExampleProjectImageListener.php @@ -2,7 +2,7 @@ namespace App\Project\EventListener; -use App\DB\Entity\Project\Special\ExampleProgram; +use App\DB\Entity\Project\Special\ExampleProject; use App\Storage\ImageRepository; use Doctrine\ORM\Event\LifecycleEventArgs; @@ -12,7 +12,7 @@ public function __construct(private readonly ImageRepository $repository) { } - public function prePersist(ExampleProgram $example, LifecycleEventArgs $event): void + public function prePersist(ExampleProject $example, LifecycleEventArgs $event): void { $file = $example->file; if (null == $file) { @@ -21,7 +21,7 @@ public function prePersist(ExampleProgram $example, LifecycleEventArgs $event): $example->setImageType($file->guessExtension()); } - public function postPersist(ExampleProgram $example, LifecycleEventArgs $event): void + public function postPersist(ExampleProject $example, LifecycleEventArgs $event): void { $file = $example->file; if (null == $file) { @@ -30,7 +30,7 @@ public function postPersist(ExampleProgram $example, LifecycleEventArgs $event): $this->repository->save($file, $example->getId(), $example->getImageType(), false); } - public function preUpdate(ExampleProgram $example, LifecycleEventArgs $event): void + public function preUpdate(ExampleProject $example, LifecycleEventArgs $event): void { $file = $example->file; if (null == $file) { @@ -41,7 +41,7 @@ public function preUpdate(ExampleProgram $example, LifecycleEventArgs $event): v $example->setImageType($file->guessExtension()); } - public function postUpdate(ExampleProgram $example, LifecycleEventArgs $event): void + public function postUpdate(ExampleProject $example, LifecycleEventArgs $event): void { $file = $example->file; if (null == $file) { @@ -50,12 +50,12 @@ public function postUpdate(ExampleProgram $example, LifecycleEventArgs $event): $this->repository->save($file, $example->getId(), $example->getImageType(), false); } - public function preRemove(ExampleProgram $example, LifecycleEventArgs $event): void + public function preRemove(ExampleProject $example, LifecycleEventArgs $event): void { $example->removed_id = $example->getId(); } - public function postRemove(ExampleProgram $example, LifecycleEventArgs $event): void + public function postRemove(ExampleProject $example, LifecycleEventArgs $event): void { $this->repository->remove($example->removed_id, $example->getImageType(), false); } diff --git a/src/Project/EventListener/FeaturedProjectImageListener.php b/src/Project/EventListener/FeaturedProjectImageListener.php index 034e22d022..5be87886a8 100644 --- a/src/Project/EventListener/FeaturedProjectImageListener.php +++ b/src/Project/EventListener/FeaturedProjectImageListener.php @@ -2,7 +2,7 @@ namespace App\Project\EventListener; -use App\DB\Entity\Project\Special\FeaturedProgram; +use App\DB\Entity\Project\Special\FeaturedProject; use App\Storage\ImageRepository; use Doctrine\ORM\Event\LifecycleEventArgs; @@ -12,7 +12,7 @@ public function __construct(private readonly ImageRepository $repository) { } - public function prePersist(FeaturedProgram $featured, LifecycleEventArgs $event): void + public function prePersist(FeaturedProject $featured, LifecycleEventArgs $event): void { $file = $featured->file; if (null == $file) { @@ -21,7 +21,7 @@ public function prePersist(FeaturedProgram $featured, LifecycleEventArgs $event) $featured->setImageType($file->guessExtension()); } - public function postPersist(FeaturedProgram $featured, LifecycleEventArgs $event): void + public function postPersist(FeaturedProject $featured, LifecycleEventArgs $event): void { $file = $featured->file; if (null == $file) { @@ -30,7 +30,7 @@ public function postPersist(FeaturedProgram $featured, LifecycleEventArgs $event $this->repository->save($file, $featured->getId(), $featured->getImageType(), true); } - public function preUpdate(FeaturedProgram $featured, LifecycleEventArgs $event): void + public function preUpdate(FeaturedProject $featured, LifecycleEventArgs $event): void { $file = $featured->file; if (null == $file) { @@ -41,7 +41,7 @@ public function preUpdate(FeaturedProgram $featured, LifecycleEventArgs $event): $featured->setImageType($file->guessExtension()); } - public function postUpdate(FeaturedProgram $featured, LifecycleEventArgs $event): void + public function postUpdate(FeaturedProject $featured, LifecycleEventArgs $event): void { $file = $featured->file; if (null == $file) { @@ -50,12 +50,12 @@ public function postUpdate(FeaturedProgram $featured, LifecycleEventArgs $event) $this->repository->save($file, $featured->getId(), $featured->getImageType(), true); } - public function preRemove(FeaturedProgram $featured, LifecycleEventArgs $event): void + public function preRemove(FeaturedProject $featured, LifecycleEventArgs $event): void { $featured->removed_id = $featured->getId(); } - public function postRemove(FeaturedProgram $featured, LifecycleEventArgs $event): void + public function postRemove(FeaturedProject $featured, LifecycleEventArgs $event): void { $this->repository->remove($featured->removed_id, $featured->getImageType(), true); } diff --git a/src/Project/EventListener/ProjectPostUpdateNotifier.php b/src/Project/EventListener/ProjectPostUpdateNotifier.php index eec30591cf..8e98cdd43e 100644 --- a/src/Project/EventListener/ProjectPostUpdateNotifier.php +++ b/src/Project/EventListener/ProjectPostUpdateNotifier.php @@ -2,7 +2,7 @@ namespace App\Project\EventListener; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\Project\Tag; use App\DB\Entity\User\User; use App\DB\EntityRepository\Project\TagRepository; @@ -16,7 +16,7 @@ public function __construct(protected AchievementManager $achievement_manager, p { } - public function postUpdate(Program $project, LifecycleEventArgs $event): void + public function postUpdate(Project $project, LifecycleEventArgs $event): void { $user = $project->getUser(); $this->addCodingJam092021Achievement($project, $user); @@ -26,7 +26,7 @@ public function postUpdate(Program $project, LifecycleEventArgs $event): void /** * @throws \Exception */ - protected function addCodingJam092021Achievement(Program $project, User $user): void + protected function addCodingJam092021Achievement(Project $project, User $user): void { $tags = $project->getTags(); /** @var Tag $tag */ @@ -46,7 +46,7 @@ protected function addCodingJam092021Achievement(Program $project, User $user): } } - private function invalidateTranslationCacheIfNecessary(Program $project): void + private function invalidateTranslationCacheIfNecessary(Project $project): void { if ($project->shouldInvalidateTranslationCache()) { $this->machine_translation_repository->invalidateCachedTranslation($project); diff --git a/src/Project/Extension/ProjectExtensionManager.php b/src/Project/Extension/ProjectExtensionManager.php index 3f5d418614..976e1ab943 100644 --- a/src/Project/Extension/ProjectExtensionManager.php +++ b/src/Project/Extension/ProjectExtensionManager.php @@ -3,7 +3,7 @@ namespace App\Project\Extension; use App\DB\Entity\Project\Extension; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\EntityRepository\Project\ExtensionRepository; use App\Project\CatrobatFile\ExtractedCatrobatFile; use Doctrine\ORM\EntityManagerInterface; @@ -18,7 +18,7 @@ public function __construct( ) { } - public function addExtensions(ExtractedCatrobatFile $extracted_file, Program $project, bool $flush = true): void + public function addExtensions(ExtractedCatrobatFile $extracted_file, Project $project, bool $flush = true): void { $project->removeAllExtensions(); @@ -34,7 +34,7 @@ public function addExtensions(ExtractedCatrobatFile $extracted_file, Program $pr $this->saveProject($project, $flush); } - public function addMultiplayerExtensions(Program $project, string $code_xml): void + public function addMultiplayerExtensions(Project $project, string $code_xml): void { if ($this->isMultiplayerProject($code_xml)) { $extension = $this->getExtension(Extension::MULTIPLAYER); @@ -44,7 +44,7 @@ public function addMultiplayerExtensions(Program $project, string $code_xml): vo } } - public function addArduinoExtensions(Program $project, string $code_xml): void + public function addArduinoExtensions(Project $project, string $code_xml): void { if ($this->isAnArduinoProject($code_xml)) { $extension = $this->getExtension(Extension::ARDUINO); @@ -54,7 +54,7 @@ public function addArduinoExtensions(Program $project, string $code_xml): void } } - public function addEmbroideryExtensions(Program $project, string $code_xml): void + public function addEmbroideryExtensions(Project $project, string $code_xml): void { if ($this->isAnEmbroideryProject($code_xml)) { $extension = $this->getExtension(Extension::EMBROIDERY); @@ -64,7 +64,7 @@ public function addEmbroideryExtensions(Program $project, string $code_xml): voi } } - public function addMindstormsExtensions(Program $project, string $code_xml): void + public function addMindstormsExtensions(Project $project, string $code_xml): void { if ($this->isAMindstormsProject($code_xml)) { $extension = $this->getExtension(Extension::MINDSTORMS); @@ -74,7 +74,7 @@ public function addMindstormsExtensions(Program $project, string $code_xml): voi } } - public function addPhiroExtensions(Program $project, string $code_xml): void + public function addPhiroExtensions(Project $project, string $code_xml): void { if ($this->isAPhiroProject($code_xml)) { $extension = $this->getExtension(Extension::PHIRO); @@ -123,7 +123,7 @@ protected function getExtension(string $internal_title): ?Extension return $extension; } - protected function saveProject(Program $project, bool $flush = true): void + protected function saveProject(Project $project, bool $flush = true): void { $this->entity_manager->persist($project); if ($flush) { diff --git a/src/Project/ProjectManager.php b/src/Project/ProjectManager.php index 2eb373548d..f890eefb97 100644 --- a/src/Project/ProjectManager.php +++ b/src/Project/ProjectManager.php @@ -2,15 +2,15 @@ namespace App\Project; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\ProgramDownloads; -use App\DB\Entity\Project\ProgramLike; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\ProjectDownloads; +use App\DB\Entity\Project\ProjectLike; use App\DB\Entity\Project\Tag; -use App\DB\Entity\User\Notifications\NewProgramNotification; +use App\DB\Entity\User\Notifications\NewProjectNotification; use App\DB\Entity\User\User; use App\DB\EntityRepository\Project\ExtensionRepository; -use App\DB\EntityRepository\Project\ProgramLikeRepository; -use App\DB\EntityRepository\Project\ProgramRepository; +use App\DB\EntityRepository\Project\ProjectLikeRepository; +use App\DB\EntityRepository\Project\ProjectRepository; use App\DB\EntityRepository\Project\Special\ExampleRepository; use App\DB\EntityRepository\Project\Special\FeaturedRepository; use App\DB\EntityRepository\Project\TagRepository; @@ -46,7 +46,7 @@ class ProjectManager { - public function __construct(protected CatrobatFileExtractor $file_extractor, protected ProjectFileRepository $file_repository, protected ScreenshotRepository $screenshot_repository, protected EntityManagerInterface $entity_manager, protected ProgramRepository $project_repository, protected TagRepository $tag_repository, protected ProgramLikeRepository $project_like_repository, protected FeaturedRepository $featured_repository, protected ExampleRepository $example_repository, protected EventDispatcherInterface $event_dispatcher, private readonly LoggerInterface $logger, protected RequestHelper $request_helper, protected ExtensionRepository $extension_repository, protected CatrobatFileSanitizer $file_sanitizer, protected NotificationManager $notification_service, private readonly TransformedFinder $program_finder, private readonly ?UrlHelper $urlHelper, protected Security $security) + public function __construct(protected CatrobatFileExtractor $file_extractor, protected ProjectFileRepository $file_repository, protected ScreenshotRepository $screenshot_repository, protected EntityManagerInterface $entity_manager, protected ProjectRepository $project_repository, protected TagRepository $tag_repository, protected ProjectLikeRepository $project_like_repository, protected FeaturedRepository $featured_repository, protected ExampleRepository $example_repository, protected EventDispatcherInterface $event_dispatcher, private readonly LoggerInterface $logger, protected RequestHelper $request_helper, protected ExtensionRepository $extension_repository, protected CatrobatFileSanitizer $file_sanitizer, protected NotificationManager $notification_service, private readonly TransformedFinder $project_finder, private readonly ?UrlHelper $urlHelper, protected Security $security) { } @@ -68,7 +68,7 @@ public function getProjectByID(string $id, bool $include_private = false): array /** * Check visibility of the given project for the current user. */ - protected function isProjectVisibleForCurrentUser(Program $project): bool + protected function isProjectVisibleForCurrentUser(Project $project): bool { /** @var User|null $user */ $user = $this->security->getUser(); @@ -99,7 +99,7 @@ protected function isProjectVisibleForCurrentUser(Program $project): bool * * @throws Exception */ - public function addProject(AddProjectRequest $request): ?Program + public function addProject(AddProjectRequest $request): ?Project { $file = $request->getProjectFile(); @@ -120,7 +120,7 @@ public function addProject(AddProjectRequest $request): ?Program return null; } - /** @var Program|null $old_project */ + /** @var Project|null $old_project */ $old_project = $this->findOneByNameAndUser($extracted_file->getName(), $request->getUser()); if (null !== $old_project) { $project = $old_project; @@ -129,7 +129,7 @@ public function addProject(AddProjectRequest $request): ?Program $project->incrementVersion(); $project->setVisible($old_project->getVisible()); // necessary to keep reported projects invisible after re-upload! } else { - $project = new Program(); + $project = new Project(); $project->setRemixRoot(true); $project->setVisible(true); } @@ -227,11 +227,11 @@ public function addProject(AddProjectRequest $request): ?Program * * @throws \Exception */ - public function createProjectFromScratch(?Program $project, User $user, array $project_data): Program + public function createProjectFromScratch(?Project $project, User $user, array $project_data): Project { $modified_time = TimeUtils::dateTimeFromScratch($project_data['history']['modified']); if (null === $project) { - $project = new Program(); + $project = new Project(); $project->setUser($user); $project->setScratchId($project_data['id']); $project->setDebugBuild(false); @@ -287,11 +287,11 @@ public function createProjectFromScratch(?Program $project, User $user, array $p } /** - * @return ProgramLike[] + * @return ProjectLike[] */ public function findUserLikes(string $project_id, string $user_id): array { - return $this->project_like_repository->findBy(['program_id' => $project_id, 'user_id' => $user_id]); + return $this->project_like_repository->findBy(['project_id' => $project_id, 'user_id' => $user_id]); } public function findProjectLikeTypes(string $project_id): array @@ -302,11 +302,11 @@ public function findProjectLikeTypes(string $project_id): array /** * @throws NoResultException|\InvalidArgumentException */ - public function changeLike(Program $project, User $user, int $type, string $action): void + public function changeLike(Project $project, User $user, int $type, string $action): void { - if (ProgramLike::ACTION_ADD === $action) { + if (ProjectLike::ACTION_ADD === $action) { $this->project_like_repository->addLike($project, $user, $type); - } elseif (ProgramLike::ACTION_REMOVE === $action) { + } elseif (ProjectLike::ACTION_REMOVE === $action) { $this->project_like_repository->removeLike($project, $user, $type); } else { throw new \InvalidArgumentException("Invalid action: {$action}"); @@ -316,7 +316,7 @@ public function changeLike(Program $project, User $user, int $type, string $acti /** * @throws NoResultException */ - public function areThereOtherLikeTypes(Program $project, User $user, int $type): bool + public function areThereOtherLikeTypes(Project $project, User $user, int $type): bool { try { return $this->project_like_repository->areThereOtherLikeTypes($project, $user, $type); @@ -335,7 +335,7 @@ public function totalLikeCount(string $project_id): int return $this->project_like_repository->totalLikeCount($project_id); } - public function addTags(Program $project, ExtractedCatrobatFile $extracted_file): void + public function addTags(Project $project, ExtractedCatrobatFile $extracted_file): void { $tags = $extracted_file->getTags(); @@ -358,7 +358,7 @@ public function addTags(Program $project, ExtractedCatrobatFile $extracted_file) } } - public function removeAllTags(Program $project): void + public function removeAllTags(Project $project): void { $tags = $project->getTags(); @@ -377,10 +377,10 @@ public function markAllProjectsAsNotYetMigrated(): void } /** - * @internal - * ATTENTION! Internal use only! (no visible/private/debug check) + * @return Project|object|null * - * @return Program|object|null + *@internal + * ATTENTION! Internal use only! (no visible/private/debug check) */ public function findOneByNameAndUser(string $project_name, UserInterface $user) { @@ -391,10 +391,10 @@ public function findOneByNameAndUser(string $project_name, UserInterface $user) } /** - * @internal - * ATTENTION! Internal use only! (no visible/private/debug check) + * @return Project|object|null * - * @return Program|object|null + *@internal + * ATTENTION! Internal use only! (no visible/private/debug check) */ public function findOneByName(string $project_name) { @@ -402,10 +402,10 @@ public function findOneByName(string $project_name) } /** - * @internal - * ATTENTION! Internal use only! (no visible/private/debug check) + * @return Project|object|null * - * @return Program|object|null + *@internal + * ATTENTION! Internal use only! (no visible/private/debug check) */ public function findOneByScratchId(int $scratch_id) { @@ -442,23 +442,23 @@ public function findNext(string $previous_project_id): mixed } /** - * @internal - * ATTENTION! Internal use only! (no visible/private/debug check) + * @return Project|object|null * - * @return Program|object|null + *@internal + * ATTENTION! Internal use only! (no visible/private/debug check) */ public function find(string $id) { return $this->project_repository->find($id); } - public function findProjectIfVisibleToCurrentUser(?string $id): ?Program + public function findProjectIfVisibleToCurrentUser(?string $id): ?Project { if (null === $id) { return null; } - /** @var Program|null $project */ + /** @var Project|null $project */ $project = $this->find($id); if (null === $project) { @@ -471,10 +471,10 @@ public function findProjectIfVisibleToCurrentUser(?string $id): ?Program } /** - * @internal - * ATTENTION! Internal use only! (no visible/private/debug check) + * @return Project|object|null * - * @return Program|object|null + *@internal + * ATTENTION! Internal use only! (no visible/private/debug check) */ public function findOneByRemixMigratedAt(?\DateTime $remix_migrated_at) { @@ -564,54 +564,54 @@ public function search(string $query, ?int $limit = 20, int $offset = 0, string { $project_query = $this->projectSearchQuery($query, $max_version, $flavor, $is_debug_request); - return $this->program_finder->find($project_query, $limit, ['from' => $offset]); + return $this->project_finder->find($project_query, $limit, ['from' => $offset]); } public function searchCount(string $query, string $max_version = '', string $flavor = null, bool $is_debug_request = false): int { $project_query = $this->projectSearchQuery($query, $max_version, $flavor, $is_debug_request); - $paginator = $this->program_finder->findPaginated($project_query); + $paginator = $this->project_finder->findPaginated($project_query); return $paginator->getNbResults(); } - public function increaseViews(Program $project): void + public function increaseViews(Project $project): void { $this->entity_manager - ->createQuery('UPDATE App\DB\Entity\Project\Program p SET p.views = p.views + 1 WHERE p.id = :pid') + ->createQuery('UPDATE App\DB\Entity\Project\Project p SET p.views = p.views + 1 WHERE p.id = :pid') ->setParameter('pid', $project->getId()) ->execute() ; } - public function increaseDownloads(Program $project, ?User $user): void + public function increaseDownloads(Project $project, ?User $user): void { - $this->increaseNumberOfDownloads($project, $user, ProgramDownloads::TYPE_PROJECT); + $this->increaseNumberOfDownloads($project, $user, ProjectDownloads::TYPE_PROJECT); } - public function increaseApkDownloads(Program $project, ?User $user): void + public function increaseApkDownloads(Project $project, ?User $user): void { - $this->increaseNumberOfDownloads($project, $user, ProgramDownloads::TYPE_APK); + $this->increaseNumberOfDownloads($project, $user, ProjectDownloads::TYPE_APK); } - protected function increaseNumberOfDownloads(Program $project, ?User $user, string $download_type): void + protected function increaseNumberOfDownloads(Project $project, ?User $user, string $download_type): void { if (!is_null($user)) { - $download_repo = $this->entity_manager->getRepository(ProgramDownloads::class); + $download_repo = $this->entity_manager->getRepository(ProjectDownloads::class); // No matter which type it should only count once! - $download = $download_repo->findOneBy(['program' => $project, 'user' => $user, 'type' => $download_type]); + $download = $download_repo->findOneBy(['project' => $project, 'user' => $user, 'type' => $download_type]); // the simplified DQL is the only solution that guarantees proper count: https://stackoverflow.com/questions/24681613/doctrine-entity-increase-value-download-counter if (is_null($download)) { - if (ProgramDownloads::TYPE_PROJECT === $download_type) { + if (ProjectDownloads::TYPE_PROJECT === $download_type) { $this->entity_manager - ->createQuery('UPDATE App\DB\Entity\Project\Program p SET p.downloads = p.downloads + 1 WHERE p.id = :pid') + ->createQuery('UPDATE App\DB\Entity\Project\Project p SET p.downloads = p.downloads + 1 WHERE p.id = :pid') ->setParameter('pid', $project->getId()) ->execute() ; - } elseif (ProgramDownloads::TYPE_APK === $download_type) { + } elseif (ProjectDownloads::TYPE_APK === $download_type) { $this->entity_manager - ->createQuery('UPDATE App\DB\Entity\Project\Program p SET p.apk_downloads = p.apk_downloads + 1 WHERE p.id = :pid') + ->createQuery('UPDATE App\DB\Entity\Project\Project p SET p.apk_downloads = p.apk_downloads + 1 WHERE p.id = :pid') ->setParameter('pid', $project->getId()) ->execute() ; @@ -621,18 +621,18 @@ protected function increaseNumberOfDownloads(Program $project, ?User $user, stri } } - protected function addDownloadEntry(Program $project, ?User $user, string $download_type): void + protected function addDownloadEntry(Project $project, ?User $user, string $download_type): void { - $download = new ProgramDownloads(); + $download = new ProjectDownloads(); $download->setUser($user); - $download->setProgram($project); + $download->setProject($project); $download->setType($download_type); $download->setDownloadedAt(new \DateTime('now')); $this->entity_manager->persist($download); $this->entity_manager->flush(); } - public function save(Program $project, ProgramDownloads $downloads = null): void + public function save(Project $project, ProjectDownloads $downloads = null): void { $this->entity_manager->persist($project); if (!is_null($downloads)) { @@ -661,7 +661,7 @@ public function searchExtensionCount(string $query): int return $this->project_repository->searchExtensionCount($query); } - public function getOtherMostDownloadedProjectsOfUsersThatAlsoDownloadedGivenProject(string $flavor, Program $project, ?int $limit, int $offset): array + public function getOtherMostDownloadedProjectsOfUsersThatAlsoDownloadedGivenProject(string $flavor, Project $project, ?int $limit, int $offset): array { return $this->project_repository->getOtherMostDownloadedProjectsOfUsersThatAlsoDownloadedGivenProject( $flavor, $project, $limit, $offset @@ -750,16 +750,16 @@ private function projectSearchQuery(string $query, string $max_version = '', str return $bool_query; } - private function notifyFollower(Program $project): void + private function notifyFollower(Project $project): void { $followers = $project->getUser()->getFollowers(); for ($i = 0; $i < $followers->count(); ++$i) { - $notification = new NewProgramNotification($followers[$i], $project); + $notification = new NewProjectNotification($followers[$i], $project); $this->notification_service->addNotification($notification); } } - public function deleteProject(Program $project): void + public function deleteProject(Project $project): void { $project->setVisible(false); $this->entity_manager->persist($project); diff --git a/src/Project/Remix/RemixGraphManipulator.php b/src/Project/Remix/RemixGraphManipulator.php index b85d93c9d9..371a388788 100644 --- a/src/Project/Remix/RemixGraphManipulator.php +++ b/src/Project/Remix/RemixGraphManipulator.php @@ -2,20 +2,20 @@ namespace App\Project\Remix; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\Scratch\ScratchProgramRemixRelation; -use App\DB\EntityRepository\Project\ProgramRemixBackwardRepository; -use App\DB\EntityRepository\Project\ProgramRemixRepository; -use App\DB\EntityRepository\Project\ScratchProgramRemixRepository; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\Scratch\ScratchProjectRemixRelation; +use App\DB\EntityRepository\Project\ProjectRemixBackwardRepository; +use App\DB\EntityRepository\Project\ProjectRemixRepository; +use App\DB\EntityRepository\Project\ScratchProjectRemixRepository; use Doctrine\ORM\EntityManagerInterface; class RemixGraphManipulator { - public function __construct(private readonly EntityManagerInterface $entity_manager, private readonly RemixSubgraphManipulator $remix_subgraph_manipulator, private readonly ProgramRemixRepository $project_remix_repository, private readonly ProgramRemixBackwardRepository $project_remix_backward_repository, private readonly ScratchProgramRemixRepository $scratch_project_remix_repository) + public function __construct(private readonly EntityManagerInterface $entity_manager, private readonly RemixSubgraphManipulator $remix_subgraph_manipulator, private readonly ProjectRemixRepository $project_remix_repository, private readonly ProjectRemixBackwardRepository $project_remix_backward_repository, private readonly ScratchProjectRemixRepository $scratch_project_remix_repository) { } - public function convertBackwardParentsHavingNoForwardAncestor(Program $project, array $removed_forward_parent_ids): void + public function convertBackwardParentsHavingNoForwardAncestor(Project $project, array $removed_forward_parent_ids): void { $removed_forward_parents_ancestor_ids = $this->project_remix_repository->getAncestorIds($removed_forward_parent_ids); $removed_forward_parents_ancestor_descendant_relations = $this->project_remix_repository->getDescendantRelations($removed_forward_parents_ancestor_ids); @@ -56,7 +56,7 @@ public function convertBackwardParentsHavingNoForwardAncestor(Program $project, /** * @param string[] $all_catrobat_forward_parent_ids */ - public function unlinkFromAllCatrobatForwardParents(Program $project, array $all_catrobat_forward_parent_ids): void + public function unlinkFromAllCatrobatForwardParents(Project $project, array $all_catrobat_forward_parent_ids): void { $project_id = $project->getId(); $parents_ancestor_ids = $this->project_remix_repository->getAncestorIds($all_catrobat_forward_parent_ids); @@ -70,12 +70,12 @@ public function unlinkFromAllCatrobatForwardParents(Program $project, array $all $preserved_edges = $this ->project_remix_repository - ->getDirectEdgeRelationsBetweenProgramIds($parents_ancestor_ids, $direct_and_indirect_descendant_ids) + ->getDirectEdgeRelationsBetweenProjectIds($parents_ancestor_ids, $direct_and_indirect_descendant_ids) ; $this ->project_remix_repository - ->removeRelationsBetweenProgramIds($parents_ancestor_ids, $direct_and_indirect_descendant_ids_with_project_id) + ->removeRelationsBetweenProjectIds($parents_ancestor_ids, $direct_and_indirect_descendant_ids_with_project_id) ; foreach ($preserved_edges as $edge) { @@ -88,7 +88,7 @@ public function unlinkFromAllCatrobatForwardParents(Program $project, array $all } } - public function unlinkFromCatrobatBackwardParents(Program $project, array $catrobat_backward_parent_ids_to_be_removed): void + public function unlinkFromCatrobatBackwardParents(Project $project, array $catrobat_backward_parent_ids_to_be_removed): void { $this ->project_remix_backward_repository @@ -96,7 +96,7 @@ public function unlinkFromCatrobatBackwardParents(Program $project, array $catro ; } - public function unlinkFromScratchParents(Program $project, array $scratch_parent_ids_to_be_removed): void + public function unlinkFromScratchParents(Project $project, array $scratch_parent_ids_to_be_removed): void { $this ->scratch_project_remix_repository @@ -104,17 +104,17 @@ public function unlinkFromScratchParents(Program $project, array $scratch_parent ; } - public function linkToScratchParents(Program $project, array $scratch_parent_ids_to_be_added): void + public function linkToScratchParents(Project $project, array $scratch_parent_ids_to_be_added): void { foreach ($scratch_parent_ids_to_be_added as $scratch_parent_id) { - $scratch_remix_relation = new ScratchProgramRemixRelation((string) $scratch_parent_id, $project); + $scratch_remix_relation = new ScratchProjectRemixRelation((string) $scratch_parent_id, $project); $this->entity_manager->detach($scratch_remix_relation); $this->entity_manager->persist($scratch_remix_relation); $this->entity_manager->flush(); } } - public function appendRemixSubgraphToCatrobatParents(Program $project, array $ids_of_new_parents, + public function appendRemixSubgraphToCatrobatParents(Project $project, array $ids_of_new_parents, array $preserved_creation_date_mapping, array $preserved_seen_date_mapping): void { diff --git a/src/Project/Remix/RemixManager.php b/src/Project/Remix/RemixManager.php index bf15c5910d..0cc3120391 100644 --- a/src/Project/Remix/RemixManager.php +++ b/src/Project/Remix/RemixManager.php @@ -2,33 +2,33 @@ namespace App\Project\Remix; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\Remix\ProgramCatrobatRemixRelationInterface; -use App\DB\Entity\Project\Remix\ProgramRemixBackwardRelation; -use App\DB\Entity\Project\Remix\ProgramRemixRelation; -use App\DB\Entity\Project\Remix\ProgramRemixRelationInterface; -use App\DB\Entity\Project\Scratch\ScratchProgram; -use App\DB\Entity\Project\Scratch\ScratchProgramRemixRelation; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\Remix\ProjectCatrobatRemixRelationInterface; +use App\DB\Entity\Project\Remix\ProjectRemixBackwardRelation; +use App\DB\Entity\Project\Remix\ProjectRemixRelation; +use App\DB\Entity\Project\Remix\ProjectRemixRelationInterface; +use App\DB\Entity\Project\Scratch\ScratchProject; +use App\DB\Entity\Project\Scratch\ScratchProjectRemixRelation; use App\DB\Entity\User\Notifications\RemixNotification; use App\DB\Entity\User\User; -use App\DB\EntityRepository\Project\ProgramRemixBackwardRepository; -use App\DB\EntityRepository\Project\ProgramRemixRepository; -use App\DB\EntityRepository\Project\ProgramRepository; -use App\DB\EntityRepository\Project\ScratchProgramRemixRepository; -use App\DB\EntityRepository\Project\ScratchProgramRepository; +use App\DB\EntityRepository\Project\ProjectRemixBackwardRepository; +use App\DB\EntityRepository\Project\ProjectRemixRepository; +use App\DB\EntityRepository\Project\ProjectRepository; +use App\DB\EntityRepository\Project\ScratchProjectRemixRepository; +use App\DB\EntityRepository\Project\ScratchProjectRepository; use App\User\Notification\NotificationManager; use App\Utils\TimeUtils; use Doctrine\ORM\EntityManagerInterface; class RemixManager { - public function __construct(private readonly EntityManagerInterface $entity_manager, private readonly ProgramRepository $project_repository, private readonly ScratchProgramRepository $scratch_project_repository, private readonly ProgramRemixRepository $project_remix_repository, private readonly ProgramRemixBackwardRepository $project_remix_backward_repository, private readonly ScratchProgramRemixRepository $scratch_project_remix_repository, private readonly RemixGraphManipulator $remix_graph_manipulator, private readonly NotificationManager $catro_notification_service) + public function __construct(private readonly EntityManagerInterface $entity_manager, private readonly ProjectRepository $project_repository, private readonly ScratchProjectRepository $scratch_project_repository, private readonly ProjectRemixRepository $project_remix_repository, private readonly ProjectRemixBackwardRepository $project_remix_backward_repository, private readonly ScratchProjectRemixRepository $scratch_project_remix_repository, private readonly RemixGraphManipulator $remix_graph_manipulator, private readonly NotificationManager $catro_notification_service) { } public function filterExistingScratchProjectIds(array $scratch_ids): array { - $scratch_project_data = $this->scratch_project_repository->getProgramDataByIds($scratch_ids); + $scratch_project_data = $this->scratch_project_repository->getProjectDataByIds($scratch_ids); return array_map(fn ($data) => $data['id'], $scratch_project_data); } @@ -41,7 +41,7 @@ public function addScratchProjects(array $scratch_info_data): void foreach ($scratch_info_data as $id => $project_data) { $scratch_project = $this->scratch_project_repository->find($id); if (null === $scratch_project) { - $scratch_project = new ScratchProgram($id); + $scratch_project = new ScratchProject($id); } $title = array_key_exists('title', $project_data) ? $project_data['title'] : null; @@ -72,7 +72,7 @@ public function addScratchProjects(array $scratch_info_data): void * * @throws \Exception */ - public function addRemixes(Program $project, array $remixes_data): void + public function addRemixes(Project $project, array $remixes_data): void { // Note: in order to avoid many slow recursive queries (MySql does not support recursive queries yet) // and a lot of complex stored procedures, we simply use Closure tables. @@ -84,7 +84,7 @@ public function addRemixes(Program $project, array $remixes_data): void } else { // case: new project $all_project_remix_relations = $this->createNewRemixRelations($project, $remixes_data); - $catrobat_remix_relations = array_filter($all_project_remix_relations, fn ($relation) => !($relation instanceof ScratchProgramRemixRelation)); + $catrobat_remix_relations = array_filter($all_project_remix_relations, fn ($relation) => !($relation instanceof ScratchProjectRemixRelation)); $contains_only_catrobat_self_relation = (1 === count($catrobat_remix_relations)); $project->setRemixRoot($contains_only_catrobat_self_relation); @@ -112,7 +112,7 @@ public function getFullRemixGraph(string $project_id): ?array $previous_descendant_ids = $catrobat_ids_of_whole_graph; // TODO: these two queries can be combined! - $catrobat_root_ids = $this->project_remix_repository->getRootProgramIds($catrobat_ids_of_whole_graph); + $catrobat_root_ids = $this->project_remix_repository->getRootProjectIds($catrobat_ids_of_whole_graph); $catrobat_ids_of_whole_graph = $this->project_remix_repository->getDescendantIds($catrobat_root_ids); $diff_new = array_diff($catrobat_ids_of_whole_graph, $previous_descendant_ids); @@ -125,7 +125,7 @@ public function getFullRemixGraph(string $project_id): ?array $catrobat_forward_edge_relations = $this ->project_remix_repository - ->getDirectEdgeRelationsBetweenProgramIds($catrobat_ids_of_whole_graph, $catrobat_ids_of_whole_graph) + ->getDirectEdgeRelationsBetweenProjectIds($catrobat_ids_of_whole_graph, $catrobat_ids_of_whole_graph) ; $catrobat_forward_relations = $this @@ -133,24 +133,24 @@ public function getFullRemixGraph(string $project_id): ?array ->getDescendantRelations($catrobat_ids_of_whole_graph) ; - $catrobat_forward_edge_data = array_map(fn (ProgramRemixRelation $relation) => [ + $catrobat_forward_edge_data = array_map(fn (ProjectRemixRelation $relation) => [ 'ancestor_id' => $relation->getAncestorId(), 'descendant_id' => $relation->getDescendantId(), 'depth' => $relation->getDepth(), ], $catrobat_forward_edge_relations); - $catrobat_forward_data = array_map(fn (ProgramRemixRelation $relation) => [ + $catrobat_forward_data = array_map(fn (ProjectRemixRelation $relation) => [ 'ancestor_id' => $relation->getAncestorId(), 'descendant_id' => $relation->getDescendantId(), 'depth' => $relation->getDepth(), ], $catrobat_forward_relations); $scratch_edge_relations = - $this->scratch_project_remix_repository->getDirectEdgeRelationsOfProgramIds($catrobat_ids_of_whole_graph); - $scratch_node_ids = array_values(array_unique(array_map(fn (ScratchProgramRemixRelation $relation) => $relation->getScratchParentId(), $scratch_edge_relations))); + $this->scratch_project_remix_repository->getDirectEdgeRelationsOfProjectIds($catrobat_ids_of_whole_graph); + $scratch_node_ids = array_values(array_unique(array_map(fn (ScratchProjectRemixRelation $relation) => $relation->getScratchParentId(), $scratch_edge_relations))); sort($scratch_node_ids); - $scratch_edge_data = array_map(fn (ScratchProgramRemixRelation $relation) => [ + $scratch_edge_data = array_map(fn (ScratchProjectRemixRelation $relation) => [ 'ancestor_id' => $relation->getScratchParentId(), 'descendant_id' => $relation->getCatrobatChildId(), ], $scratch_edge_relations); @@ -160,7 +160,7 @@ public function getFullRemixGraph(string $project_id): ?array ->getDirectEdgeRelations($catrobat_ids_of_whole_graph, $catrobat_ids_of_whole_graph) ; - $catrobat_backward_edge_data = array_map(fn (ProgramRemixBackwardRelation $relation) => [ + $catrobat_backward_edge_data = array_map(fn (ProjectRemixBackwardRelation $relation) => [ 'ancestor_id' => $relation->getParentId(), 'descendant_id' => $relation->getChildId(), ], $catrobat_backward_edge_relations); @@ -172,7 +172,7 @@ public function getFullRemixGraph(string $project_id): ?array } $scratch_nodes_data = []; - $scratch_projects_data = $this->scratch_project_repository->getProgramDataByIds($scratch_node_ids); + $scratch_projects_data = $this->scratch_project_repository->getProjectDataByIds($scratch_node_ids); foreach ($scratch_projects_data as $scratch_project_data) { $scratch_nodes_data[$scratch_project_data['id']] = $scratch_project_data; } @@ -236,7 +236,7 @@ public function markAllUnseenRemixRelationsAsSeen(\DateTime $seen_at): void /** * @throws \Exception */ - public function markRemixRelationAsSeen(ProgramCatrobatRemixRelationInterface $remix_relation): void + public function markRemixRelationAsSeen(ProjectCatrobatRemixRelationInterface $remix_relation): void { $now = TimeUtils::getDateTime(); $remix_relation->setSeenAt($now); @@ -283,7 +283,7 @@ public function remixCount(string $project_id): int return (is_countable($result['catrobatNodes']) ? count($result['catrobatNodes']) : 0) - 1; } - public function getProjectRepository(): ProgramRepository + public function getProjectRepository(): ProjectRepository { return $this->project_repository; } @@ -291,13 +291,13 @@ public function getProjectRepository(): ProgramRepository /** * @param RemixData[] $remixes_data * - * @return ProgramRemixRelationInterface[] + * @return ProjectRemixRelationInterface[] */ - private function createNewRemixRelations(Program $project, array $remixes_data): array + private function createNewRemixRelations(Project $project, array $remixes_data): array { $all_project_remix_relations = []; - $project_remix_self_relation = new ProgramRemixRelation($project, $project, 0); + $project_remix_self_relation = new ProjectRemixRelation($project, $project, 0); $all_project_remix_relations[$project_remix_self_relation->getUniqueKey()] = $project_remix_self_relation; foreach ($remixes_data as $remix_data) { @@ -309,14 +309,14 @@ private function createNewRemixRelations(Program $project, array $remixes_data): // case: immediate parent is Scratch project if ($remix_data->isScratchProject()) { - $scratch_project_remix_relation = new ScratchProgramRemixRelation($parent_project_id, $project); + $scratch_project_remix_relation = new ScratchProjectRemixRelation($parent_project_id, $project); $unique_key = $scratch_project_remix_relation->getUniqueKey(); $all_project_remix_relations[$unique_key] = $scratch_project_remix_relation; continue; } // case: immediate parent is Catrobat project - /** @var Program|null $parent_project */ + /** @var Project|null $parent_project */ $parent_project = $this->project_repository->find($parent_project_id); if (null === $parent_project) { continue; @@ -337,18 +337,18 @@ private function createNewRemixRelations(Program $project, array $remixes_data): } /** - * @param ProgramRemixRelationInterface[] $all_project_remix_relations + * @param ProjectRemixRelationInterface[] $all_project_remix_relations */ - private function createNewCatrobatRemixRelations(Program $project, Program $parent_project, + private function createNewCatrobatRemixRelations(Project $project, Project $parent_project, array &$all_project_remix_relations): void { - $project_remix_relation_to_immediate_parent = new ProgramRemixRelation($parent_project, $project, 1); + $project_remix_relation_to_immediate_parent = new ProjectRemixRelation($parent_project, $project, 1); $unique_key = $project_remix_relation_to_immediate_parent->getUniqueKey(); $all_project_remix_relations[$unique_key] = $project_remix_relation_to_immediate_parent; // Catrobat grandparents, parents of grandparents, etc... // (i.e. all nodes along all directed paths upwards to roots) - /** @var ProgramRemixRelation[] $all_parent_ancestor_relations */ + /** @var ProjectRemixRelation[] $all_parent_ancestor_relations */ $all_parent_ancestor_relations = $this->project_remix_repository ->findBy(['descendant_id' => $parent_project->getId()]) ; @@ -357,7 +357,7 @@ private function createNewCatrobatRemixRelations(Program $project, Program $pare $parent_ancestor = $parent_ancestor_relation->getAncestor(); $parent_ancestor_depth = $parent_ancestor_relation->getDepth(); - $project_remix_relation_to_more_distant_catrobat_ancestor = new ProgramRemixRelation( + $project_remix_relation_to_more_distant_catrobat_ancestor = new ProjectRemixRelation( $parent_ancestor, $project, $parent_ancestor_depth + 1 @@ -370,7 +370,7 @@ private function createNewCatrobatRemixRelations(Program $project, Program $pare /** * @throws \Exception */ - private function updateProjectRemixRelations(Program $project, array $remixes_data): void + private function updateProjectRemixRelations(Project $project, array $remixes_data): void { $graph_manipulator = $this->remix_graph_manipulator; @@ -378,24 +378,24 @@ private function updateProjectRemixRelations(Program $project, array $remixes_da $catrobat_remixes_data = array_filter($remixes_data, fn (RemixData $remix_data) => !$remix_data->isScratchProject()); $new_unfiltered_catrobat_parent_ids = array_map(fn (RemixData $remix_data) => $remix_data->getProjectId(), $catrobat_remixes_data); $new_catrobat_parent_ids = - $this->project_repository->filterExistingProgramIds($new_unfiltered_catrobat_parent_ids); + $this->project_repository->filterExistingProjectIds($new_unfiltered_catrobat_parent_ids); $old_forward_ancestor_relations = $project->getCatrobatRemixAncestorRelations()->getValues(); - $old_forward_parent_relations = array_filter($old_forward_ancestor_relations, fn (ProgramRemixRelation $relation) => 1 === $relation->getDepth()); - $old_forward_parent_ids = array_map(fn (ProgramRemixRelation $relation) => $relation->getAncestorId(), $old_forward_parent_relations); + $old_forward_parent_relations = array_filter($old_forward_ancestor_relations, fn (ProjectRemixRelation $relation) => 1 === $relation->getDepth()); + $old_forward_parent_ids = array_map(fn (ProjectRemixRelation $relation) => $relation->getAncestorId(), $old_forward_parent_relations); $preserved_creation_date_mapping = []; $preserved_seen_date_mapping = []; - /** @var ProgramRemixRelation $relation */ + /** @var ProjectRemixRelation $relation */ foreach ($old_forward_ancestor_relations as $relation) { $preserved_creation_date_mapping[$relation->getUniqueKey()] = $relation->getCreatedAt(); $preserved_seen_date_mapping[$relation->getUniqueKey()] = $relation->getSeenAt(); } $old_backward_ancestor_relations = $project->getCatrobatRemixBackwardParentRelations()->getValues(); - $old_backward_parent_relations = array_filter($old_backward_ancestor_relations, fn (ProgramRemixBackwardRelation $relation) => 1 === $relation->getDepth()); - $old_backward_parent_ids = array_map(fn (ProgramRemixBackwardRelation $relation) => $relation->getParentId(), $old_backward_parent_relations); + $old_backward_parent_relations = array_filter($old_backward_ancestor_relations, fn (ProjectRemixBackwardRelation $relation) => 1 === $relation->getDepth()); + $old_backward_parent_ids = array_map(fn (ProjectRemixBackwardRelation $relation) => $relation->getParentId(), $old_backward_parent_relations); $old_catrobat_parent_ids = array_unique([...$old_forward_parent_ids, ...$old_backward_parent_ids]); $parent_ids_to_be_added = array_values(array_diff($new_catrobat_parent_ids, $old_catrobat_parent_ids)); @@ -423,7 +423,7 @@ private function updateProjectRemixRelations(Program $project, array $remixes_da // scratch parents: $old_scratch_parent_relations = $project->getScratchRemixParentRelations()->getValues(); - $old_immediate_scratch_parent_ids = array_map(fn (ScratchProgramRemixRelation $relation) => $relation->getScratchParentId(), $old_scratch_parent_relations); + $old_immediate_scratch_parent_ids = array_map(fn (ScratchProjectRemixRelation $relation) => $relation->getScratchParentId(), $old_scratch_parent_relations); $scratch_remixes_data = array_filter($remixes_data, fn (RemixData $remix_data) => $remix_data->isScratchProject()); $new_scratch_parent_ids = array_map(fn (RemixData $remix_data) => $remix_data->getProjectId(), $scratch_remixes_data); @@ -457,7 +457,7 @@ private function updateProjectRemixRelations(Program $project, array $remixes_da } /** - * @return ProgramCatrobatRemixRelationInterface[] + * @return ProjectCatrobatRemixRelationInterface[] */ private function getUnseenRemixRelationsOfUser(User $user): array { diff --git a/src/Project/Remix/RemixSubgraphManipulator.php b/src/Project/Remix/RemixSubgraphManipulator.php index 26245f7053..5602426be0 100644 --- a/src/Project/Remix/RemixSubgraphManipulator.php +++ b/src/Project/Remix/RemixSubgraphManipulator.php @@ -2,12 +2,12 @@ namespace App\Project\Remix; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\Remix\ProgramRemixBackwardRelation; -use App\DB\Entity\Project\Remix\ProgramRemixRelation; -use App\DB\EntityRepository\Project\ProgramRemixBackwardRepository; -use App\DB\EntityRepository\Project\ProgramRemixRepository; -use App\DB\EntityRepository\Project\ProgramRepository; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\Remix\ProjectRemixBackwardRelation; +use App\DB\Entity\Project\Remix\ProjectRemixRelation; +use App\DB\EntityRepository\Project\ProjectRemixBackwardRepository; +use App\DB\EntityRepository\Project\ProjectRemixRepository; +use App\DB\EntityRepository\Project\ProjectRepository; use Doctrine\ORM\EntityManagerInterface; class RemixSubgraphManipulator @@ -17,11 +17,11 @@ class RemixSubgraphManipulator */ final public const COMMON_TIMESTAMP = 'common_timestamp'; - public function __construct(private readonly EntityManagerInterface $entity_manager, private readonly ProgramRepository $project_repository, private readonly ProgramRemixRepository $project_remix_repository, private readonly ProgramRemixBackwardRepository $project_remix_backward_repository) + public function __construct(private readonly EntityManagerInterface $entity_manager, private readonly ProjectRepository $project_repository, private readonly ProjectRemixRepository $project_remix_repository, private readonly ProjectRemixBackwardRepository $project_remix_backward_repository) { } - public function appendRemixSubgraphToCatrobatParents(Program $project, array $ids_of_new_parents, + public function appendRemixSubgraphToCatrobatParents(Project $project, array $ids_of_new_parents, array $preserved_creation_date_mapping, array $preserved_seen_date_mapping): void { @@ -46,7 +46,7 @@ public function appendRemixSubgraphToCatrobatParents(Program $project, array $id // case backward relation: foreach ($backward_parent_ids as $backward_parent_id) { $parent_project = $this->project_repository->find($backward_parent_id); - $project_remix_backward_relation = new ProgramRemixBackwardRelation($parent_project, $project); + $project_remix_backward_relation = new ProjectRemixBackwardRelation($parent_project, $project); $unique_key = $project_remix_backward_relation->getUniqueKey(); if (!in_array($unique_key, $unique_keys_of_all_existing_relations, true)) { @@ -57,7 +57,7 @@ public function appendRemixSubgraphToCatrobatParents(Program $project, array $id // case forward relation: foreach ($project_descendant_relations as $descendant_relation) { foreach ($parents_ancestor_relations as $parent_catrobat_relation) { - $project_remix_relation = new ProgramRemixRelation( + $project_remix_relation = new ProjectRemixRelation( $parent_catrobat_relation->getAncestor(), $descendant_relation->getDescendant(), $parent_catrobat_relation->getDepth() + $descendant_relation->getDepth() + 1 diff --git a/src/Project/Remix/RemixUpdaterEventSubscriber.php b/src/Project/Remix/RemixUpdaterEventSubscriber.php index 815171603f..698dc693f5 100644 --- a/src/Project/Remix/RemixUpdaterEventSubscriber.php +++ b/src/Project/Remix/RemixUpdaterEventSubscriber.php @@ -2,7 +2,7 @@ namespace App\Project\Remix; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Project\CatrobatFile\ExtractedCatrobatFile; use App\Project\Event\ProjectAfterInsertEvent; use App\Project\Scratch\AsyncHttpClient; @@ -38,7 +38,7 @@ public function onProjectAfterInsert(ProjectAfterInsertEvent $event): void * * @psalm-suppress UndefinedPropertyAssignment */ - public function update(ExtractedCatrobatFile $file, Program $project): void + public function update(ExtractedCatrobatFile $file, Project $project): void { $remixes_data = $file->getRemixesData( $project->getId(), diff --git a/src/Project/Scratch/ScratchManager.php b/src/Project/Scratch/ScratchManager.php index 3eace8e9bd..d13164afcf 100644 --- a/src/Project/Scratch/ScratchManager.php +++ b/src/Project/Scratch/ScratchManager.php @@ -2,7 +2,7 @@ namespace App\Project\Scratch; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Project\ProjectManager; use App\User\UserManager; @@ -19,14 +19,14 @@ public function __construct(protected ProjectManager $project_manager, /** * @throws \Exception */ - public function createScratchProjectFromId(int $id): ?Program + public function createScratchProjectFromId(int $id): ?Project { $project_arr = $this->async_http_client->fetchScratchProjectDetails([$id]); if (null == $project_arr) { return null; } $project_data = $project_arr[$id]; - /** @var Program|null $old_project */ + /** @var Project|null $old_project */ $old_project = $this->project_manager->findOneByScratchId($id); if (null === $old_project) { $user = $this->user_manager->createUserFromScratch($project_data['author']); diff --git a/src/Studio/StudioManager.php b/src/Studio/StudioManager.php index 51864f2101..b49e03e21e 100644 --- a/src/Studio/StudioManager.php +++ b/src/Studio/StudioManager.php @@ -2,17 +2,17 @@ namespace App\Studio; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\Studio\Studio; use App\DB\Entity\Studio\StudioActivity; use App\DB\Entity\Studio\StudioJoinRequest; -use App\DB\Entity\Studio\StudioProgram; +use App\DB\Entity\Studio\StudioProject; use App\DB\Entity\Studio\StudioUser; use App\DB\Entity\User\Comment\UserComment; use App\DB\Entity\User\User; use App\DB\EntityRepository\Studios\StudioActivityRepository; use App\DB\EntityRepository\Studios\StudioJoinRequestRepository; -use App\DB\EntityRepository\Studios\StudioProgramRepository; +use App\DB\EntityRepository\Studios\StudioProjectRepository; use App\DB\EntityRepository\Studios\StudioRepository; use App\DB\EntityRepository\Studios\StudioUserRepository; use App\DB\EntityRepository\User\Comment\UserCommentRepository; @@ -24,7 +24,7 @@ public function __construct( protected EntityManagerInterface $entity_manager, protected StudioRepository $studio_repository, protected StudioActivityRepository $studio_activity_repository, - protected StudioProgramRepository $studio_project_repository, + protected StudioProjectRepository $studio_project_repository, protected StudioUserRepository $studio_user_repository, protected UserCommentRepository $user_comment_repository, protected StudioJoinRequestRepository $studio_join_request_repository @@ -99,13 +99,13 @@ protected function createStudioComment(User $user, Studio $studio, StudioActivit return $comment; } - protected function createStudioProgram(User $user, Studio $studio, StudioActivity $activity, Program $project): StudioProgram + protected function createStudioProgram(User $user, Studio $studio, StudioActivity $activity, Project $project): StudioProject { - $studioProject = (new StudioProgram()) + $studioProject = (new StudioProject()) ->setStudio($studio) ->setActivity($activity) ->setUser($user) - ->setProgram($project) + ->setProject($project) ->setCreatedOn(new \DateTime()) ; @@ -159,7 +159,7 @@ public function addCommentToStudio(User $user, Studio $studio, string $comment_t return $this->createStudioComment($user, $studio, $activity, $comment_text, $parent_id); } - public function addProjectToStudio(User $user, Studio $studio, Program $project): ?StudioProgram + public function addProjectToStudio(User $user, Studio $studio, Project $project): ?StudioProject { if (!$this->isUserInStudio($user, $studio)) { return null; @@ -249,7 +249,7 @@ public function deleteCommentFromStudio(User $user, int $comment_id): void } } - public function deleteProjectFromStudio(User $user, Studio $studio, Program $program): void + public function deleteProjectFromStudio(User $user, Studio $studio, Project $program): void { $studio_project = $this->findStudioProject($studio, $program); @@ -373,7 +373,7 @@ public function findAllStudioProjects(Studio $studio): array return $this->studio_project_repository->findAllStudioProjects($studio); } - public function findStudioProject(Studio $studio, Program $program): ?StudioProgram + public function findStudioProject(Studio $studio, Project $program): ?StudioProject { return $this->studio_project_repository->findStudioProject($studio, $program); } diff --git a/src/System/Commands/Create/CreateCommentCommand.php b/src/System/Commands/Create/CreateCommentCommand.php index f83ed92b33..20b2cd0bdc 100644 --- a/src/System/Commands/Create/CreateCommentCommand.php +++ b/src/System/Commands/Create/CreateCommentCommand.php @@ -2,7 +2,7 @@ namespace App\System\Commands\Create; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\Comment\UserComment; use App\DB\Entity\User\Notifications\CommentNotification; use App\DB\Entity\User\User; @@ -27,7 +27,7 @@ protected function configure(): void $this->setName('catrobat:comment') ->setDescription('Add comment to a project') ->addArgument('user', InputArgument::REQUIRED, 'User who comments on program') - ->addArgument('program_name', InputArgument::REQUIRED, 'Program name of program to comment on') + ->addArgument('program_name', InputArgument::REQUIRED, 'Project name of program to comment on') ->addArgument('message', InputArgument::REQUIRED, 'Comment message') ->addArgument('reported', InputArgument::REQUIRED, 'Boolean if it should be a reported comment') ; @@ -65,13 +65,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - private function postComment(User $user, Program $program, string $message, bool $reported): void + private function postComment(User $user, Project $program, string $message, bool $reported): void { $comment = new UserComment(); $comment->setUsername($user->getUsername()); $comment->setUser($user); $comment->setText($message); - $comment->setProgram($program); + $comment->setProject($program); $comment->setUploadDate(date_create()); $comment->setIsReported($reported); diff --git a/src/System/Commands/Create/CreateDownloadsCommand.php b/src/System/Commands/Create/CreateDownloadsCommand.php index 3eee1402be..77301fd94f 100644 --- a/src/System/Commands/Create/CreateDownloadsCommand.php +++ b/src/System/Commands/Create/CreateDownloadsCommand.php @@ -2,8 +2,8 @@ namespace App\System\Commands\Create; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\ProgramDownloads; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\ProjectDownloads; use App\DB\Entity\User\User; use App\Project\ProjectManager; use App\User\UserManager; @@ -54,11 +54,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - private function downloadProgram(Program $program, User $user): void + private function downloadProgram(Project $program, User $user): void { - $download = new ProgramDownloads(); + $download = new ProjectDownloads(); $download->setUser($user); - $download->setProgram($program); + $download->setProject($program); $download->setDownloadedAt(date_create()); $program->setDownloads($program->getDownloads() + 1); diff --git a/src/System/Commands/Create/CreateExampleProgramCommand.php b/src/System/Commands/Create/CreateExampleProgramCommand.php index c7ce1f2309..965e45f5eb 100644 --- a/src/System/Commands/Create/CreateExampleProgramCommand.php +++ b/src/System/Commands/Create/CreateExampleProgramCommand.php @@ -2,8 +2,8 @@ namespace App\System\Commands\Create; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\Special\ExampleProgram; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\Special\ExampleProject; use App\DB\EntityRepository\FlavorRepository; use App\Project\ProjectManager; use Doctrine\ORM\EntityManagerInterface; @@ -56,10 +56,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int /** * @throws \Exception */ - private function exampleProgram(Program $program): void + private function exampleProgram(Project $program): void { - $example = new ExampleProgram(); - $example->setProgram($program); + $example = new ExampleProject(); + $example->setProject($program); $example->setActive(true); $example->setFlavor(random_int(0, 1) ? $this->flavor_repository->getFlavorByName('arduino') : $this->flavor_repository->getFlavorByName('embroidery')); $example->setImageType('jpeg'); // todo picture? diff --git a/src/System/Commands/Create/CreateFeatureProgramCommand.php b/src/System/Commands/Create/CreateFeatureProgramCommand.php index ad670d23d9..aa790de552 100644 --- a/src/System/Commands/Create/CreateFeatureProgramCommand.php +++ b/src/System/Commands/Create/CreateFeatureProgramCommand.php @@ -2,8 +2,8 @@ namespace App\System\Commands\Create; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\Special\FeaturedProgram; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\Special\FeaturedProject; use App\DB\EntityRepository\FlavorRepository; use App\Project\ProjectManager; use Doctrine\ORM\EntityManagerInterface; @@ -51,10 +51,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - private function featureProgram(Program $program): void + private function featureProgram(Project $program): void { - $feature = new FeaturedProgram(); - $feature->setProgram($program); + $feature = new FeaturedProject(); + $feature->setProject($program); $feature->setActive(true); $feature->setFlavor($this->flavor_repository->getFlavorByName('pocketcode')); $feature->setImageType('jpeg'); // todo picture? diff --git a/src/System/Commands/Create/CreateLikeCommand.php b/src/System/Commands/Create/CreateLikeCommand.php index 95cc2ea517..64767f567c 100644 --- a/src/System/Commands/Create/CreateLikeCommand.php +++ b/src/System/Commands/Create/CreateLikeCommand.php @@ -2,8 +2,8 @@ namespace App\System\Commands\Create; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\ProgramLike; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\ProjectLike; use App\DB\Entity\User\Notifications\LikeNotification; use App\DB\Entity\User\User; use App\Project\ProjectManager; @@ -69,11 +69,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - private function likeProgram(Program $program, User $user): void + private function likeProgram(Project $program, User $user): void { - $program_like = $this->entity_manager->getRepository(ProgramLike::class)->findOneBy(['program' => $program, 'user' => $user]); + $program_like = $this->entity_manager->getRepository(ProjectLike::class)->findOneBy(['project' => $program, 'user' => $user]); if (null === $program_like) { - $like = new ProgramLike($program, $user, array_rand(ProgramLike::$TYPE_NAMES)); + $like = new ProjectLike($program, $user, array_rand(ProjectLike::$TYPE_NAMES)); $this->entity_manager->persist($like); $this->entity_manager->flush(); } diff --git a/src/System/Commands/Create/CreateProgramInappropriateReportCommand.php b/src/System/Commands/Create/CreateProgramInappropriateReportCommand.php index f8ce56bab7..0ffd705001 100644 --- a/src/System/Commands/Create/CreateProgramInappropriateReportCommand.php +++ b/src/System/Commands/Create/CreateProgramInappropriateReportCommand.php @@ -2,8 +2,8 @@ namespace App\System\Commands\Create; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\ProgramInappropriateReport; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\ProjectInappropriateReport; use App\DB\Entity\User\User; use App\Project\ProjectManager; use App\User\UserManager; @@ -64,14 +64,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - private function reportProgram(Program $program, User $user, string $note): void + private function reportProgram(Project $program, User $user, string $note): void { - $report = new ProgramInappropriateReport(); + $report = new ProjectInappropriateReport(); $report->setReportingUser($user); $program->setVisible(false); $report->setCategory('Inappropriate'); $report->setNote($note); - $report->setProgram($program); + $report->setProject($program); $report->setReportedUser($program->getUser()); $this->entity_manager->persist($report); $this->entity_manager->flush(); diff --git a/src/System/Commands/DBUpdater/CronJobs/AchievementWorkflow_Translation_Command.php b/src/System/Commands/DBUpdater/CronJobs/AchievementWorkflow_Translation_Command.php index 14677da1f8..078cc29cd8 100644 --- a/src/System/Commands/DBUpdater/CronJobs/AchievementWorkflow_Translation_Command.php +++ b/src/System/Commands/DBUpdater/CronJobs/AchievementWorkflow_Translation_Command.php @@ -2,7 +2,7 @@ namespace App\System\Commands\DBUpdater\CronJobs; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\Translation\ProjectCustomTranslation; use App\DB\Entity\User\User; use App\User\Achievements\AchievementManager; @@ -33,7 +33,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $qb = $this->entity_manager->createQueryBuilder(); $users = $qb->select('u') ->from(ProjectCustomTranslation::class, 'e') - ->from(Program::class, 'p') + ->from(Project::class, 'p') ->from(User::class, 'u') ->where($qb->expr()->eq('e.project', 'p')) ->andWhere($qb->expr()->eq('p.user', 'u')) diff --git a/src/System/Commands/DBUpdater/CronJobs/ProjectRefreshExtensionsWorkflowCommand.php b/src/System/Commands/DBUpdater/CronJobs/ProjectRefreshExtensionsWorkflowCommand.php index cda01cf100..805872c888 100644 --- a/src/System/Commands/DBUpdater/CronJobs/ProjectRefreshExtensionsWorkflowCommand.php +++ b/src/System/Commands/DBUpdater/CronJobs/ProjectRefreshExtensionsWorkflowCommand.php @@ -2,8 +2,8 @@ namespace App\System\Commands\DBUpdater\CronJobs; -use App\DB\Entity\Project\Program; -use App\DB\EntityRepository\Project\ProgramRepository; +use App\DB\Entity\Project\Project; +use App\DB\EntityRepository\Project\ProjectRepository; use App\Project\CatrobatFile\ExtractedFileRepository; use App\Project\Extension\ProjectExtensionManager; use App\Project\ProjectManager; @@ -15,7 +15,7 @@ class ProjectRefreshExtensionsWorkflowCommand extends Command { public function __construct(protected ProjectManager $program_manager, - protected ProgramRepository $program_repository, + protected ProjectRepository $program_repository, protected ProjectExtensionManager $extension_manager, protected ExtractedFileRepository $extracted_file_repo, protected EntityManagerInterface $entity_manager) @@ -49,7 +49,7 @@ protected function refreshProjectExtensions(): void ; foreach ($iterator as $projects) { - /** @var Program $project */ + /** @var Project $project */ $project = $projects[0]; $extracted_file = $this->extracted_file_repo->loadProjectExtractedFile($project); if (!is_null($extracted_file)) { diff --git a/src/System/Commands/DBUpdater/CronJobs/UpdateRandomProjectCategoryCommand.php b/src/System/Commands/DBUpdater/CronJobs/UpdateRandomProjectCategoryCommand.php index 4c36ef26fd..4b5f1b970d 100644 --- a/src/System/Commands/DBUpdater/CronJobs/UpdateRandomProjectCategoryCommand.php +++ b/src/System/Commands/DBUpdater/CronJobs/UpdateRandomProjectCategoryCommand.php @@ -2,7 +2,7 @@ namespace App\System\Commands\DBUpdater\CronJobs; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Project\ProjectManager; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Console\Command\Command; @@ -34,7 +34,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $qb = $this->entity_manager->createQueryBuilder(); $random_id_list = $qb->select('p.id') - ->from(Program::class, 'p') + ->from(Project::class, 'p') ->setMaxResults(self::LIMIT) ->orderBy('RAND()', 'DESC') ->getQuery() @@ -44,7 +44,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $rand_value = 1; foreach ($random_id_list as $arr_project) { $id = $arr_project['id']; - /** @var Program|null $program */ + /** @var Project|null $program */ $program = $this->program_manager->find($id); $program->setRand($rand_value); ++$rand_value; @@ -59,7 +59,7 @@ protected function resetCategoryOfIndex(string $index): void { $qb = $this->entity_manager->createQueryBuilder(); $qb->update() - ->from(Program::class, 'p') + ->from(Project::class, 'p') ->where("p.{$index} <> 0") ->set("p.{$index}", 0) ->getQuery() diff --git a/src/System/Commands/DBUpdater/UpdateProjectPopularityCommand.php b/src/System/Commands/DBUpdater/UpdateProjectPopularityCommand.php index 9b547e6d3d..0514459b14 100644 --- a/src/System/Commands/DBUpdater/UpdateProjectPopularityCommand.php +++ b/src/System/Commands/DBUpdater/UpdateProjectPopularityCommand.php @@ -2,12 +2,12 @@ namespace App\System\Commands\DBUpdater; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\ProgramLike; -use App\DB\Entity\Project\Remix\ProgramRemixRelation; -use App\DB\EntityRepository\Project\ProgramLikeRepository; -use App\DB\EntityRepository\Project\ProgramRemixRepository; -use App\DB\EntityRepository\Project\ProgramRepository; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\ProjectLike; +use App\DB\Entity\Project\Remix\ProjectRemixRelation; +use App\DB\EntityRepository\Project\ProjectLikeRepository; +use App\DB\EntityRepository\Project\ProjectRemixRepository; +use App\DB\EntityRepository\Project\ProjectRepository; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Query\Expr\Join; use Symfony\Component\Console\Command\Command; @@ -24,7 +24,7 @@ class UpdateProjectPopularityCommand extends Command final public const REMIXES_W = 45; final public const REACTIONS_W = 15; - public function __construct(protected EntityManagerInterface $entity_manager, protected ProgramRepository $program_repository, protected ProgramRemixRepository $program_remix_repository, protected ProgramLikeRepository $program_like_repository) + public function __construct(protected EntityManagerInterface $entity_manager, protected ProjectRepository $program_repository, protected ProjectRemixRepository $program_remix_repository, protected ProjectLikeRepository $program_like_repository) { parent::__construct(); } @@ -57,14 +57,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int return Command::SUCCESS; } - protected function computePopularity(Program $program, array $min_max_values): float + protected function computePopularity(Project $program, array $min_max_values): float { $normalized_data = $this->getNormalizedData($program, $min_max_values); return round($normalized_data['views'] * self::VIEWS_W + $normalized_data['downloads'] * self::DOWNLOADS_W + $normalized_data['remixes'] * self::REMIXES_W + $normalized_data['reactions'] * self::REACTIONS_W, 2); } - protected function getNormalizedData(Program $program, array $min_max_values): array + protected function getNormalizedData(Project $program, array $min_max_values): array { return [ 'views' => $this->scale($program->getViews(), $min_max_values['views_min'], $min_max_values['views_max']), @@ -127,8 +127,8 @@ protected function getMinMaxRemixes(): array $query_builder = $this->entity_manager->createQueryBuilder(); $query_builder ->select('COUNT(r.ancestor_id) as count') - ->from(Program::class, 'p') - ->leftJoin(ProgramRemixRelation::class, 'r', Join::WITH, 'p.id = r.ancestor_id') + ->from(Project::class, 'p') + ->leftJoin(ProjectRemixRelation::class, 'r', Join::WITH, 'p.id = r.ancestor_id') ->groupBy('r.ancestor_id') ->orderBy('count', 'DESC') ; @@ -148,10 +148,10 @@ protected function getMinMaxReactions(): array $query_builder = $this->entity_manager->createQueryBuilder(); $query_builder - ->select('COUNT(e.program_id) as count') - ->from(Program::class, 'p') - ->leftJoin(ProgramLike::class, 'e', Join::WITH, 'p.id = e.program_id') - ->groupBy('e.program_id') + ->select('COUNT(e.project_id) as count') + ->from(Project::class, 'p') + ->leftJoin(ProjectLike::class, 'e', Join::WITH, 'p.id = e.project_id') + ->groupBy('e.project_id') ->orderBy('count', 'DESC') ->setMaxResults(1) ; diff --git a/src/System/Commands/DBUpdater/UpdateUserRankingCommand.php b/src/System/Commands/DBUpdater/UpdateUserRankingCommand.php index b5d6206263..0dc7a52233 100644 --- a/src/System/Commands/DBUpdater/UpdateUserRankingCommand.php +++ b/src/System/Commands/DBUpdater/UpdateUserRankingCommand.php @@ -2,7 +2,7 @@ namespace App\System\Commands\DBUpdater; -use App\DB\EntityRepository\Project\ProgramRepository; +use App\DB\EntityRepository\Project\ProjectRepository; use App\DB\EntityRepository\User\UserRepository; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Console\Command\Command; @@ -11,7 +11,7 @@ class UpdateUserRankingCommand extends Command { - public function __construct(protected EntityManagerInterface $entity_manager, protected UserRepository $userRepository, protected ProgramRepository $programRepository) + public function __construct(protected EntityManagerInterface $entity_manager, protected UserRepository $userRepository, protected ProjectRepository $programRepository) { parent::__construct(); } diff --git a/src/System/Commands/Maintenance/CleanApkCommand.php b/src/System/Commands/Maintenance/CleanApkCommand.php index cd49395773..b7bd38a31d 100644 --- a/src/System/Commands/Maintenance/CleanApkCommand.php +++ b/src/System/Commands/Maintenance/CleanApkCommand.php @@ -2,7 +2,7 @@ namespace App\System\Commands\Maintenance; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Storage\FileHelper; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\NonUniqueResultException; @@ -39,9 +39,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int FileHelper::emptyDirectory($apk_dir); $query = $this->entity_manager - ->createQuery('UPDATE App\DB\Entity\Project\Program p SET p.apk_status = :status WHERE p.apk_status != :status') + ->createQuery('UPDATE App\DB\Entity\Project\Project p SET p.apk_status = :status WHERE p.apk_status != :status') ; - $query->setParameter('status', Program::APK_NONE); + $query->setParameter('status', Project::APK_NONE); $result = $query->getSingleScalarResult(); $output1->writeln('Reset the apk status of '.$result.' projects'); diff --git a/src/System/Commands/Maintenance/CleanOldApkCommand.php b/src/System/Commands/Maintenance/CleanOldApkCommand.php index 6d4c190317..349dc07770 100644 --- a/src/System/Commands/Maintenance/CleanOldApkCommand.php +++ b/src/System/Commands/Maintenance/CleanOldApkCommand.php @@ -2,7 +2,7 @@ namespace App\System\Commands\Maintenance; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Utils\TimeUtils; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\NonUniqueResultException; @@ -97,9 +97,9 @@ private function createQueryToUpdateTheStatusOfRemovedApks(mixed $removed_apk_id } $query = $this->entity_manager->createQuery( - 'UPDATE App\DB\Entity\Project\Program p SET p.apk_status = :status WHERE p.apk_status != :status'.$id_query_part + 'UPDATE App\DB\Entity\Project\Project p SET p.apk_status = :status WHERE p.apk_status != :status'.$id_query_part ); - $query->setParameter('status', Program::APK_NONE); + $query->setParameter('status', Project::APK_NONE); return $query; } diff --git a/src/System/Commands/MigrateRemixGraphsCommand.php b/src/System/Commands/MigrateRemixGraphsCommand.php index 1c09f3c448..d8dbfaf02f 100644 --- a/src/System/Commands/MigrateRemixGraphsCommand.php +++ b/src/System/Commands/MigrateRemixGraphsCommand.php @@ -2,9 +2,9 @@ namespace App\System\Commands; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; -use App\DB\EntityRepository\Project\ProgramRepository; +use App\DB\EntityRepository\Project\ProjectRepository; use App\Project\CatrobatFile\CatrobatFileExtractor; use App\Project\ProjectManager; use App\Project\Remix\RemixData; @@ -40,7 +40,7 @@ class MigrateRemixGraphsCommand extends Command public function __construct(private readonly UserManager $user_manager, private readonly ProjectManager $project_manager, private readonly RemixManager $remix_manager, private readonly EntityManagerInterface $entity_manager, private readonly CatrobatFileExtractor $file_extractor, - private readonly ProgramRepository $project_repository, ParameterBagInterface $parameter_bag) + private readonly ProjectRepository $project_repository, ParameterBagInterface $parameter_bag) { parent::__construct(); $this->async_http_client = new AsyncHttpClient(['timeout' => 12, 'max_number_of_concurrent_requests' => 10]); @@ -115,7 +115,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int */ private function migrateRemixDataOfExistingProjects(OutputInterface $output, string $directory): void { - /* @var Program $unmigrated_project */ + /* @var Project $unmigrated_project */ $migration_start_time = TimeUtils::getDateTime(); $progress_bar_format_simple = '%current%/%max% [%bar%] %percent:3s%% | Elapsed: %elapsed:6s% | Status: %message%'; @@ -285,7 +285,7 @@ private function extractRemixData(mixed $project_file_path, mixed $project_id, m // ---------------------------------------------------------------------------------------------------------- $url_data = $extracted_file->getRemixesData('.'.PHP_INT_MAX, true, $this->project_repository, false); assert(1 == count($url_data), 'WTH! This project has multiple urls with different project IDs?!!'); - assert($url_data[0]->getProgramId() == $project_id); + assert($url_data[0]->getProjectId() == $project_id); // $remix_of_string = $extracted_file->getRemixMigrationUrlsString(); $remix_data_only_forward_parents = $extracted_file->getRemixesData($project_id, true, $this->project_repository, true); @@ -315,7 +315,7 @@ private function extractRemixData(mixed $project_file_path, mixed $project_id, m /** * @throws \Exception */ - private function addRemixData(Program $project, array $remixes_data, bool $is_update = false): void + private function addRemixData(Project $project, array $remixes_data, bool $is_update = false): void { $scratch_remixes_data = array_filter($remixes_data, fn (RemixData $remix_data): bool => $remix_data->isScratchProject()); $scratch_info_data = []; @@ -328,7 +328,7 @@ private function addRemixData(Program $project, array $remixes_data, bool $is_up } $preserved_version = $project->getVersion(); - $project->setVersion($is_update ? (Program::INITIAL_VERSION + 1) : Program::INITIAL_VERSION); + $project->setVersion($is_update ? (Project::INITIAL_VERSION + 1) : Project::INITIAL_VERSION); $this->remix_manager->addScratchProjects($scratch_info_data); $this->remix_manager->addRemixes($project, $remixes_data); @@ -368,7 +368,7 @@ private function debugImportMissingProjects(OutputInterface $output, string $dir $progress_bar->start(); $number_imported_projects = 0; - $metadata = $this->entity_manager->getClassMetaData(Program::class); + $metadata = $this->entity_manager->getClassMetaData(Project::class); $metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE); $batch_size = 300; @@ -401,7 +401,7 @@ private function debugImportMissingProjects(OutputInterface $output, string $dir continue; } - $project = new Program(); + $project = new Project(); $project->setId($project_id); $project->setName($extracted_file->getName()); $project->setDescription($extracted_file->getDescription()); diff --git a/src/System/Commands/Reset/ResetCommand.php b/src/System/Commands/Reset/ResetCommand.php index 6442c6550b..dd7962fc03 100644 --- a/src/System/Commands/Reset/ResetCommand.php +++ b/src/System/Commands/Reset/ResetCommand.php @@ -2,8 +2,8 @@ namespace App\System\Commands\Reset; -use App\DB\Entity\Project\Program; -use App\DB\EntityRepository\Project\ProgramRepository; +use App\DB\Entity\Project\Project; +use App\DB\EntityRepository\Project\ProjectRepository; use App\System\Commands\Helpers\CommandHelper; use App\System\Commands\ImportProjects\ProgramImportCommand; use Symfony\Component\Console\Command\Command; @@ -18,7 +18,7 @@ class ResetCommand extends Command private array $reported = []; - public function __construct(private readonly ProgramRepository $program_manager, private readonly ParameterBagInterface $parameter_bag) + public function __construct(private readonly ProjectRepository $program_manager, private readonly ParameterBagInterface $parameter_bag) { parent::__construct(); } @@ -108,7 +108,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $programs = $this->program_manager->findAll(); $program_names = []; - /** @var Program $program */ + /** @var Project $program */ foreach ($programs as $program) { $program_names[] = $program->getName(); } diff --git a/src/System/Testing/Behat/Context/ApiContext.php b/src/System/Testing/Behat/Context/ApiContext.php index 67992db73e..0672621819 100644 --- a/src/System/Testing/Behat/Context/ApiContext.php +++ b/src/System/Testing/Behat/Context/ApiContext.php @@ -3,11 +3,11 @@ namespace App\System\Testing\Behat\Context; use App\Api\Exceptions\ApiVersionNotSupportedException; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\Remix\ProgramRemixBackwardRelation; -use App\DB\Entity\Project\Remix\ProgramRemixRelation; -use App\DB\Entity\Project\Scratch\ScratchProgramRemixRelation; -use App\DB\Entity\Project\Special\FeaturedProgram; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\Remix\ProjectRemixBackwardRelation; +use App\DB\Entity\Project\Remix\ProjectRemixRelation; +use App\DB\Entity\Project\Scratch\ScratchProjectRemixRelation; +use App\DB\Entity\Project\Special\FeaturedProject; use App\DB\Entity\User\User; use App\DB\Generator\MyUuidGenerator; use App\System\Testing\Behat\ContextTrait; @@ -452,7 +452,7 @@ public function iReportProjectWithNote(mixed $project_id, mixed $category, mixed { $url = '/app/api/reportProject/reportProject.json'; $this->request_parameters = [ - 'program' => $project_id, + 'project' => $project_id, 'category' => $category, 'note' => $note, ]; @@ -536,7 +536,7 @@ public function theUploadedProjectShouldBeARemixRoot(string $api_version): void public function theUploadedProjectShouldExistInTheDatabase(string $api_version): void { // Trying to find the id of the last uploaded project in the database - $uploaded_project = $this->getManager()->getRepository(Program::class)->findOneBy([ + $uploaded_project = $this->getManager()->getRepository(Project::class)->findOneBy([ 'id' => $this->getIDOfLastUploadedProject($api_version), ]); @@ -1107,7 +1107,7 @@ public function theResponseShouldContain(mixed $needle): void */ public function theResponseShouldContainALocationHeaderWithURLOfTheUploadedProject(): void { - $uploaded_project = $this->getManager()->getRepository(Program::class)->findOneBy([ + $uploaded_project = $this->getManager()->getRepository(Project::class)->findOneBy([ 'name' => 'test', ]); @@ -1865,7 +1865,7 @@ public function theUploadProblem(mixed $problem): void $this->request_parameters['username'] = 'Catrobat'; $this->request_parameters['token'] = 'cccccccccc'; break; - case 'invalid program file': + case 'invalid project file': $this->method = 'POST'; $this->url = '/app/api/upload/upload.json'; $this->request_parameters['username'] = 'Catrobat'; @@ -1994,7 +1994,7 @@ public function iUploadTheGeneratedProjectWithIdAndName(mixed $id, mixed $name, { $this->uploadProject(sys_get_temp_dir().'/project_generated.catrobat', $api_version, null, $id); - /** @var Program $project */ + /** @var Project $project */ $project = $this->getProjectManager()->find($id); $project->setName($name); $this->getProjectManager()->save($project); @@ -2332,7 +2332,7 @@ public function theProjectShouldBeARemixRoot(mixed $project_id): void public function theProjectShouldNotBeARemixRoot(mixed $project_id): void { $project_manager = $this->getProjectManager(); - /** @var Program $uploaded_project */ + /** @var Project $uploaded_project */ $uploaded_project = $project_manager->find($project_id); Assert::assertFalse($uploaded_project->isRemixRoot()); } @@ -2362,7 +2362,7 @@ public function theProjectShouldHaveNoFurtherScratchParents(mixed $project_id): ]); $further_scratch_parent_relations = array_filter($direct_edge_relations, - fn (ScratchProgramRemixRelation $relation): bool => !array_key_exists( + fn (ScratchProjectRemixRelation $relation): bool => !array_key_exists( $relation->getUniqueKey(), $this->checked_catrobat_remix_forward_ancestor_relations )); @@ -2416,7 +2416,7 @@ public function theProjectShouldHaveNoCatrobatForwardAncestorsExceptSelfRelation ; Assert::assertCount(0, array_filter($forward_ancestors_including_self_referencing_relation, - fn (ProgramRemixRelation $relation): bool => $relation->getDepth() >= 1)); + fn (ProjectRemixRelation $relation): bool => $relation->getDepth() >= 1)); } /** @@ -2430,7 +2430,7 @@ public function theProjectShouldHaveNoFurtherCatrobatForwardAncestors(mixed $pro ; $further_forward_ancestor_relations = array_filter($forward_ancestors_including_self_referencing_relation, - fn (ProgramRemixRelation $relation): bool => !array_key_exists( + fn (ProjectRemixRelation $relation): bool => !array_key_exists( $relation->getUniqueKey(), $this->checked_catrobat_remix_forward_ancestor_relations )); @@ -2454,7 +2454,7 @@ public function theProjectShouldHaveNoFurtherCatrobatBackwardParents(mixed $proj $backward_parent_relations = $this->getProjectRemixBackwardRepository()->findBy(['child_id' => $project_id]); $further_backward_parent_relations = array_filter($backward_parent_relations, - fn (ProgramRemixBackwardRelation $relation): bool => !array_key_exists( + fn (ProjectRemixBackwardRelation $relation): bool => !array_key_exists( $relation->getUniqueKey(), $this->checked_catrobat_remix_backward_relations )); @@ -2484,7 +2484,7 @@ public function theProjectShouldHaveNoScratchParents(mixed $project_id): void */ public function theProjectShouldHaveCatrobatForwardDescendantHavingIdAndDepth(mixed $project_id, mixed $descendant_project_id, mixed $depth): void { - /** @var ProgramRemixRelation $forward_descendant_relation */ + /** @var ProjectRemixRelation $forward_descendant_relation */ $forward_descendant_relation = $this->getProjectRemixForwardRepository()->findOneBy([ 'ancestor_id' => $project_id, 'descendant_id' => $descendant_project_id, @@ -2512,7 +2512,7 @@ public function theProjectShouldHaveNoCatrobatForwardDescendantsExceptSelfRelati ; Assert::assertCount(0, array_filter($forward_ancestors_including_self_referencing_relation, - fn (ProgramRemixRelation $relation): bool => $relation->getDepth() >= 1)); + fn (ProjectRemixRelation $relation): bool => $relation->getDepth() >= 1)); } /** @@ -2526,7 +2526,7 @@ public function theProjectShouldHaveNoFurtherCatrobatForwardDescendants(mixed $p ; $further_forward_descendant_relations = array_filter($forward_descendants_including_self_referencing_relation, - fn (ProgramRemixRelation $relation): bool => !array_key_exists( + fn (ProjectRemixRelation $relation): bool => !array_key_exists( $relation->getUniqueKey(), $this->checked_catrobat_remix_forward_descendant_relations )); @@ -2539,7 +2539,7 @@ public function theProjectShouldHaveNoFurtherCatrobatForwardDescendants(mixed $p public function theProjectShouldHaveRemixofInTheXml(mixed $project_id, mixed $value): void { $project_manager = $this->getProjectManager(); - /** @var Program $uploaded_project */ + /** @var Project $uploaded_project */ $uploaded_project = $project_manager->find($project_id); $efr = $this->getExtractedFileRepository(); $extracted_catrobat_file = $efr->loadProjectExtractedFile($uploaded_project); @@ -2724,7 +2724,7 @@ private function getStoredProjects(array $expected_projects): array { $projects = array_merge($this->dataFixturesContext->getProjects(), $this->new_uploaded_projects); $stored_projects = []; - /** @var Program $project */ + /** @var Project $project */ foreach ($projects as $project) { if (!$this->expectProject($expected_projects, $project->getName())) { continue; @@ -2753,13 +2753,13 @@ private function getStoredFeaturedProjects(array $expected_projects): array { $featured_projects = $this->dataFixturesContext->getFeaturedProjects(); $projects = []; - /** @var FeaturedProgram $featured_project */ + /** @var FeaturedProject $featured_project */ foreach ($featured_projects as $featured_project) { - if (!$this->expectProject($expected_projects, $featured_project->getProgram()->getName())) { + if (!$this->expectProject($expected_projects, $featured_project->getProject()->getName())) { continue; } $url = $featured_project->getUrl(); - $project_url = 'http://localhost/app/project/'.$featured_project->getProgram()->getId(); + $project_url = 'http://localhost/app/project/'.$featured_project->getProject()->getId(); if (empty($url)) { $url = $project_url; } else { @@ -2767,9 +2767,9 @@ private function getStoredFeaturedProjects(array $expected_projects): array } $result = [ 'id' => $featured_project->getId(), - 'name' => $featured_project->getProgram()->getName(), - 'author' => $featured_project->getProgram()->getUser()->getUserIdentifier(), - 'project_id' => $featured_project->getProgram()->getId(), + 'name' => $featured_project->getProject()->getName(), + 'author' => $featured_project->getProject()->getUser()->getUserIdentifier(), + 'project_id' => $featured_project->getProject()->getId(), 'project_url' => $project_url, 'url' => $url, 'featured_image' => 'http://localhost/resources_test/featured/featured_'.$featured_project->getId().'.jpg', @@ -2804,7 +2804,7 @@ private function getStoredUsers(): array 'id' => $user->getId(), 'username' => $user->getUsername(), 'email' => $user->getEmail(), - 'projects' => $user->getPrograms()->count(), + 'projects' => $user->getProjects()->count(), 'followers' => $user->getFollowers()->count(), 'following' => $user->getFollowing()->count(), ]; diff --git a/src/System/Testing/Behat/Context/CatrowebBrowserContext.php b/src/System/Testing/Behat/Context/CatrowebBrowserContext.php index b397979e72..091bf820e3 100644 --- a/src/System/Testing/Behat/Context/CatrowebBrowserContext.php +++ b/src/System/Testing/Behat/Context/CatrowebBrowserContext.php @@ -2,7 +2,7 @@ namespace App\System\Testing\Behat\Context; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\Comment\UserComment; use App\DB\Entity\User\Notifications\CatroNotification; use App\DB\Entity\User\RecommenderSystem\UserLikeSimilarityRelation; @@ -38,7 +38,7 @@ class CatrowebBrowserContext extends BrowserContext protected bool $use_real_oauth_javascript_code = false; - protected ?Program $my_project = null; + protected ?Project $my_project = null; // ------------------------------------------------------------------------------------------------------------------- // Initialization @@ -1186,9 +1186,9 @@ public function theProjectApkStatusWillBeFlagged(mixed $arg1): void $pm = $this->getProjectManager(); $project = $pm->find('1'); match ($arg1) { - 'pending' => Assert::assertEquals(Program::APK_PENDING, $project->getApkStatus()), - 'ready' => Assert::assertEquals(Program::APK_READY, $project->getApkStatus()), - 'none' => Assert::assertEquals(Program::APK_NONE, $project->getApkStatus()), + 'pending' => Assert::assertEquals(Project::APK_PENDING, $project->getApkStatus()), + 'ready' => Assert::assertEquals(Project::APK_READY, $project->getApkStatus()), + 'none' => Assert::assertEquals(Project::APK_NONE, $project->getApkStatus()), default => throw new PendingException('Unknown state: '.$arg1), }; } @@ -1220,16 +1220,16 @@ public function theProjectApkStatusIsFlagged(mixed $arg1): void $project = $pm->find('1'); switch ($arg1) { case 'pending': - $project->setApkStatus(Program::APK_PENDING); + $project->setApkStatus(Project::APK_PENDING); break; case 'ready': - $project->setApkStatus(Program::APK_READY); + $project->setApkStatus(Project::APK_READY); /* @var $apk_repository ApkRepository */ $apk_repository = $this->getSymfonyService(ApkRepository::class); $apk_repository->save(new File(strval($this->getTempCopy($this->FIXTURES_DIR.'/test.catrobat'))), $project->getId()); break; default: - $project->setApkStatus(Program::APK_NONE); + $project->setApkStatus(Project::APK_NONE); } $pm->save($project); } @@ -1586,7 +1586,7 @@ public function projectWithIdShouldHaveNoApk(mixed $project_id): void { $project_manager = $this->getProjectManager(); $project = $project_manager->find($project_id); - Assert::assertEquals(Program::APK_NONE, $project->getApkStatus()); + Assert::assertEquals(Project::APK_NONE, $project->getApkStatus()); } /** diff --git a/src/System/Testing/Behat/Context/DataFixturesContext.php b/src/System/Testing/Behat/Context/DataFixturesContext.php index 2a60dd9ba0..9bd3117779 100644 --- a/src/System/Testing/Behat/Context/DataFixturesContext.php +++ b/src/System/Testing/Behat/Context/DataFixturesContext.php @@ -7,9 +7,9 @@ use App\DB\Entity\MediaLibrary\MediaPackageCategory; use App\DB\Entity\MediaLibrary\MediaPackageFile; use App\DB\Entity\Project\Extension; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\ProgramLike; -use App\DB\Entity\Project\Special\FeaturedProgram; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\ProjectLike; +use App\DB\Entity\Project\Special\FeaturedProject; use App\DB\Entity\Project\Tag; use App\DB\Entity\Studio\Studio; use App\DB\Entity\Studio\StudioActivity; @@ -27,7 +27,7 @@ use App\DB\Entity\User\Notifications\CommentNotification; use App\DB\Entity\User\Notifications\FollowNotification; use App\DB\Entity\User\Notifications\LikeNotification; -use App\DB\Entity\User\Notifications\NewProgramNotification; +use App\DB\Entity\User\Notifications\NewProjectNotification; use App\DB\Entity\User\Notifications\RemixNotification; use App\DB\Entity\User\User; use App\DB\Generator\MyUuidGenerator; @@ -420,7 +420,7 @@ public function thereAreDownloadableProjects(TableNode $table): void public function thereAreFeaturedProjects(TableNode $table): void { foreach ($table->getHash() as $config) { - /** @var FeaturedProgram $project */ + /** @var FeaturedProject $project */ $project = $this->insertFeaturedProject($config, false); $this->featured_projects[] = $project; } @@ -522,7 +522,7 @@ public function theProjectShouldBeTaggedWithInTheDatabase(mixed $arg1): void */ public function theProjectShouldHaveNoExtension(): void { - /** @var Program $project */ + /** @var Project $project */ $project = $this->getProjectManager()->findAll()[0]; Assert::assertNotNull($project->getExtensions()); } @@ -532,7 +532,7 @@ public function theProjectShouldHaveNoExtension(): void */ public function theProjectShouldHaveDownloads(mixed $id, mixed $downloads): void { - /** @var Program $project */ + /** @var Project $project */ $project = $this->getProjectManager()->find($id); $this->getManager()->refresh($project); Assert::assertEquals($downloads, $project->getDownloads()); @@ -906,16 +906,16 @@ public function thereAreProjectReactions(TableNode $table): void if (ctype_digit($type)) { $type = (int) $type; } else { - $type = array_search($type, ProgramLike::$TYPE_NAMES, true); + $type = array_search($type, ProjectLike::$TYPE_NAMES, true); if (false === $type) { throw new \Exception('Unknown type "'.$data['type'].'" given.'); } } - if (!ProgramLike::isValidType($type)) { + if (!ProjectLike::isValidType($type)) { throw new \Exception('Unknown type "'.$data['type'].'" given.'); } - $like = new ProgramLike($project, $user, $type); + $like = new ProjectLike($project, $user, $type); if (array_key_exists('created at', $data) && !empty(trim((string) $data['created at']))) { $like->setCreatedAt(new \DateTime($data['created at'], new \DateTimeZone('UTC'))); @@ -960,15 +960,15 @@ public function thereAreCatroNotifications(TableNode $table): void break; case 'follow_project': $project = $this->getProjectManager()->find($notification['project_id']); - $to_create = new NewProgramNotification($user, $project); + $to_create = new NewProjectNotification($user, $project); break; case 'broadcast': $to_create = new BroadcastNotification($user, 'title_deprecated', $notification['message']); break; case 'remix': - /** @var Program $parent_project */ + /** @var Project $parent_project */ $parent_project = $this->getProjectManager()->find($notification['parent_project']); - /** @var Program $child_project */ + /** @var Project $child_project */ $child_project = $this->getProjectManager()->find($notification['child_project']); $to_create = new RemixNotification($user, $parent_project->getUser(), $parent_project, $child_project); break; @@ -1046,7 +1046,7 @@ public function thereAreSpecificNotificationsFor(mixed $amount, mixed $type, mix $temp_comment->setUsername($user->getUserIdentifier()); $temp_comment->setUser($user); $temp_comment->setText('This is a comment'); - $temp_comment->setProgram($project); + $temp_comment->setProject($project); $temp_comment->setUploadDate(date_create()); $temp_comment->setIsReported(false); $em->persist($temp_comment); @@ -1463,7 +1463,7 @@ public function thereShouldBeProjectMachineTranslations(TableNode $table): void Assert::assertEquals(count($table_rows), count($project_machine_translations), 'table has different number of rows'); foreach ($project_machine_translations as $translation) { - /** @var Program $project */ + /** @var Project $project */ $project = $translation->getProject(); $project_id = $project->getId(); $source_language = $translation->getSourceLanguage(); diff --git a/src/System/Testing/Behat/ContextTrait.php b/src/System/Testing/Behat/ContextTrait.php index 3c82085296..38c34faf75 100644 --- a/src/System/Testing/Behat/ContextTrait.php +++ b/src/System/Testing/Behat/ContextTrait.php @@ -4,14 +4,14 @@ use App\DB\Entity\Flavor; use App\DB\Entity\Project\Extension; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\ProgramInappropriateReport; -use App\DB\Entity\Project\ProgramLike; -use App\DB\Entity\Project\Remix\ProgramRemixBackwardRelation; -use App\DB\Entity\Project\Remix\ProgramRemixRelation; -use App\DB\Entity\Project\Scratch\ScratchProgramRemixRelation; -use App\DB\Entity\Project\Special\ExampleProgram; -use App\DB\Entity\Project\Special\FeaturedProgram; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\ProjectInappropriateReport; +use App\DB\Entity\Project\ProjectLike; +use App\DB\Entity\Project\Remix\ProjectRemixBackwardRelation; +use App\DB\Entity\Project\Remix\ProjectRemixRelation; +use App\DB\Entity\Project\Scratch\ScratchProjectRemixRelation; +use App\DB\Entity\Project\Special\ExampleProject; +use App\DB\Entity\Project\Special\FeaturedProject; use App\DB\Entity\Project\Tag; use App\DB\Entity\User\Comment\UserComment; use App\DB\Entity\User\RecommenderSystem\UserLikeSimilarityRelation; @@ -20,10 +20,10 @@ use App\DB\EntityRepository\FlavorRepository; use App\DB\EntityRepository\MediaLibrary\MediaPackageFileRepository; use App\DB\EntityRepository\Project\ExtensionRepository; -use App\DB\EntityRepository\Project\ProgramRemixBackwardRepository; -use App\DB\EntityRepository\Project\ProgramRemixRepository; -use App\DB\EntityRepository\Project\ScratchProgramRemixRepository; -use App\DB\EntityRepository\Project\ScratchProgramRepository; +use App\DB\EntityRepository\Project\ProjectRemixBackwardRepository; +use App\DB\EntityRepository\Project\ProjectRemixRepository; +use App\DB\EntityRepository\Project\ScratchProjectRemixRepository; +use App\DB\EntityRepository\Project\ScratchProjectRepository; use App\DB\EntityRepository\Project\TagRepository; use App\DB\EntityRepository\System\CronJobRepository; use App\DB\EntityRepository\User\Notification\NotificationRepository; @@ -124,24 +124,24 @@ public function getExtensionRepository(): ?ExtensionRepository return $this->kernel->getContainer()->get(ExtensionRepository::class); } - public function getProjectRemixForwardRepository(): ?ProgramRemixRepository + public function getProjectRemixForwardRepository(): ?ProjectRemixRepository { - return $this->kernel->getContainer()->get(ProgramRemixRepository::class); + return $this->kernel->getContainer()->get(ProjectRemixRepository::class); } - public function getProjectRemixBackwardRepository(): ?ProgramRemixBackwardRepository + public function getProjectRemixBackwardRepository(): ?ProjectRemixBackwardRepository { - return $this->kernel->getContainer()->get(ProgramRemixBackwardRepository::class); + return $this->kernel->getContainer()->get(ProjectRemixBackwardRepository::class); } - public function getScratchProjectRepository(): ?ScratchProgramRepository + public function getScratchProjectRepository(): ?ScratchProjectRepository { - return $this->kernel->getContainer()->get(ScratchProgramRepository::class); + return $this->kernel->getContainer()->get(ScratchProjectRepository::class); } - public function getScratchProjectRemixRepository(): ?ScratchProgramRemixRepository + public function getScratchProjectRemixRepository(): ?ScratchProjectRemixRepository { - return $this->kernel->getContainer()->get(ScratchProgramRemixRepository::class); + return $this->kernel->getContainer()->get(ScratchProjectRemixRepository::class); } public function getFileRepository(): ?ProjectFileRepository @@ -283,7 +283,7 @@ public function insertUserRemixSimilarity(array $config = [], bool $andFlush = t /** * @throws \Exception */ - public function insertProjectLike(array $config = [], bool $andFlush = true): ProgramLike + public function insertProjectLike(array $config = [], bool $andFlush = true): ProjectLike { $user_manager = $this->getUserManager(); $project_manager = $this->getProjectManager(); @@ -293,7 +293,7 @@ public function insertProjectLike(array $config = [], bool $andFlush = true): Pr $project = $project_manager->find($config['project_id']); - $project_like = new ProgramLike($project, $user, $config['type']); + $project_like = new ProjectLike($project, $user, $config['type']); $project_like->setCreatedAt(new \DateTime($config['created at'], new \DateTimeZone('UTC'))); $this->getManager()->persist($project_like); @@ -334,15 +334,15 @@ public function insertExtension(array $config = [], bool $andFlush = true): Exte return $extension; } - public function insertForwardRemixRelation(array $config = [], bool $andFlush = true): ProgramRemixRelation + public function insertForwardRemixRelation(array $config = [], bool $andFlush = true): ProjectRemixRelation { - /** @var Program $ancestor */ + /** @var Project $ancestor */ $ancestor = $this->getProjectManager()->find($config['ancestor_id']); - /** @var Program $descendant */ + /** @var Project $descendant */ $descendant = $this->getProjectManager()->find($config['descendant_id']); - $forward_relation = new ProgramRemixRelation($ancestor, $descendant, (int) $config['depth']); + $forward_relation = new ProjectRemixRelation($ancestor, $descendant, (int) $config['depth']); $this->getManager()->persist($forward_relation); if ($andFlush) { @@ -352,15 +352,15 @@ public function insertForwardRemixRelation(array $config = [], bool $andFlush = return $forward_relation; } - public function insertBackwardRemixRelation(array $config = [], bool $andFlush = true): ProgramRemixBackwardRelation + public function insertBackwardRemixRelation(array $config = [], bool $andFlush = true): ProjectRemixBackwardRelation { - /** @var Program $parent */ + /** @var Project $parent */ $parent = $this->getProjectManager()->find($config['parent_id']); - /** @var Program $child */ + /** @var Project $child */ $child = $this->getProjectManager()->find($config['child_id']); - $backward_relation = new ProgramRemixBackwardRelation($parent, $child); + $backward_relation = new ProjectRemixBackwardRelation($parent, $child); $this->getManager()->persist($backward_relation); if ($andFlush) { @@ -370,12 +370,12 @@ public function insertBackwardRemixRelation(array $config = [], bool $andFlush = return $backward_relation; } - public function insertScratchRemixRelation(array $config = [], bool $andFlush = true): ScratchProgramRemixRelation + public function insertScratchRemixRelation(array $config = [], bool $andFlush = true): ScratchProjectRemixRelation { - /** @var Program $catrobat_child */ + /** @var Project $catrobat_child */ $catrobat_child = $this->getProjectManager()->find($config['catrobat_child_id']); - $scratch_relation = new ScratchProgramRemixRelation( + $scratch_relation = new ScratchProjectRemixRelation( $config['scratch_parent_id'], $catrobat_child ); @@ -391,7 +391,7 @@ public function insertScratchRemixRelation(array $config = [], bool $andFlush = /** * @throws \Exception */ - public function insertProject(array $config, bool $andFlush = true): Program + public function insertProject(array $config, bool $andFlush = true): Project { return $this->getProjectDataFixtures()->insertProject($config, $andFlush); } @@ -401,18 +401,18 @@ public function assertProject(array $config = []): void $this->getProjectDataFixtures()->assertProject($config); } - public function insertFeaturedProject(array $config, bool $andFlush = true): FeaturedProgram + public function insertFeaturedProject(array $config, bool $andFlush = true): FeaturedProject { $new_flavor = []; - $featured_project = new FeaturedProgram(); + $featured_project = new FeaturedProject(); - /* @var Program $project */ + /* @var Project $project */ if (isset($config['project_id'])) { $project = $this->getProjectManager()->find($config['project_id']); } else { $project = $this->getProjectManager()->findOneByName($config['name']); } - $featured_project->setProgram($project); + $featured_project->setProject($project); /* @var Flavor $flavor */ $flavor = $this->getFlavorRepository()->getFlavorByName($config['flavor'] ?? 'pocketcode'); @@ -436,18 +436,18 @@ public function insertFeaturedProject(array $config, bool $andFlush = true): Fea return $featured_project; } - public function insertExampleProject(array $config, bool $andFlush = true): ExampleProgram + public function insertExampleProject(array $config, bool $andFlush = true): ExampleProject { $new_flavor = []; - $example_project = new ExampleProgram(); + $example_project = new ExampleProject(); - /* @var Program $project */ + /* @var Project $project */ if (isset($config['project_id'])) { $project = $this->getProjectManager()->find($config['project_id']); - $example_project->setProgram($project); + $example_project->setProject($project); } else { $project = $this->getProjectManager()->findOneByName($config['name']); - $example_project->setProgram($project); + $example_project->setProject($project); } /* @var Flavor $flavor */ @@ -476,7 +476,7 @@ public function insertExampleProject(array $config, bool $andFlush = true): Exam */ public function insertUserComment(array $config, bool $andFlush = true): UserComment { - /** @var Program $project */ + /** @var Project $project */ $project = $this->getProjectManager()->find($config['project_id']); /** @var User|null $user */ @@ -491,7 +491,7 @@ public function insertUserComment(array $config, bool $andFlush = true): UserCom new \DateTime($config['upload_date'], new \DateTimeZone('UTC')) : new \DateTime('01.01.2013 12:00', new \DateTimeZone('UTC')) ); - $new_comment->setProgram($project); + $new_comment->setProject($project); $new_comment->setUser($user); $new_comment->setParentId($parent_id); $new_comment->setIsDeleted($is_deleted); @@ -517,17 +517,17 @@ public function insertUserComment(array $config, bool $andFlush = true): UserCom /** * @throws \Exception */ - public function insertProjectReport(array $config, bool $andFlush = true): ProgramInappropriateReport + public function insertProjectReport(array $config, bool $andFlush = true): ProjectInappropriateReport { - /** @var Program $project */ + /** @var Project $project */ $project = $this->getProjectManager()->find($config['project_id']); /** @var User|null $user */ $user = $this->getUserManager()->find($config['user_id']); - $new_report = new ProgramInappropriateReport(); + $new_report = new ProjectInappropriateReport(); $new_report->setCategory($config['category']); - $new_report->setProgram($project); + $new_report->setProject($project); $new_report->setReportingUser($user); $new_report->setTime(new \DateTime($config['time'], new \DateTimeZone('UTC'))); $new_report->setNote($config['note']); diff --git a/src/System/Testing/DataFixtures/ProjectDataFixtures.php b/src/System/Testing/DataFixtures/ProjectDataFixtures.php index 00169dde04..4bfb818b8a 100644 --- a/src/System/Testing/DataFixtures/ProjectDataFixtures.php +++ b/src/System/Testing/DataFixtures/ProjectDataFixtures.php @@ -3,7 +3,7 @@ namespace App\System\Testing\DataFixtures; use App\DB\Entity\Project\Extension; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\Project\Tag; use App\DB\Entity\User\User; use App\DB\Generator\MyUuidGenerator; @@ -47,7 +47,7 @@ public function __construct(private readonly UserManager $user_manager, private /** * @throws \Exception */ - public function insertProject(array $config, bool $andFlush = true): Program + public function insertProject(array $config, bool $andFlush = true): Project { ++ProjectDataFixtures::$number_of_projects; @@ -61,7 +61,7 @@ public function insertProject(array $config, bool $andFlush = true): Program MyUuidGenerator::setNextValue($config['id']); } - $project = new Program(); + $project = new Project(); $project->setUser($user); $project->setName($config['name'] ?? 'Project '.ProjectDataFixtures::$number_of_projects); @@ -73,11 +73,11 @@ public function insertProject(array $config, bool $andFlush = true): Program $project->setApkDownloads(isset($config['apk_downloads']) ? (int) $config['apk_downloads'] : 0); if (isset($config['apk_status']) && 'ready' === $config['apk_status'] || (isset($config['apk_ready']) && 'true' === $config['apk_ready'])) { - $project->setApkStatus(Program::APK_READY); + $project->setApkStatus(Project::APK_READY); } elseif (isset($config['apk_status']) && 'pending' === $config['apk_status']) { - $project->setApkStatus(Program::APK_PENDING); + $project->setApkStatus(Project::APK_PENDING); } else { - $project->setApkStatus(Program::APK_NONE); + $project->setApkStatus(Project::APK_NONE); } $project->setUploadedAt( isset($config['upload time']) ? @@ -125,7 +125,7 @@ public function insertProject(array $config, bool $andFlush = true): Program } } - if (Program::APK_READY === $project->getApkStatus()) { + if (Project::APK_READY === $project->getApkStatus()) { $temp_path = tempnam(sys_get_temp_dir(), 'apktest'); copy($this->FIXTURE_DIR.'test.catrobat', $temp_path); $this->apk_repository->save(new File($temp_path), $project->getId()); diff --git a/src/System/Testing/FakeTranslationDelegate.php b/src/System/Testing/FakeTranslationDelegate.php index 0b3cb9953e..36398eac40 100644 --- a/src/System/Testing/FakeTranslationDelegate.php +++ b/src/System/Testing/FakeTranslationDelegate.php @@ -2,13 +2,13 @@ namespace App\System\Testing; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Translation\TranslationDelegate; use App\Translation\TranslationResult; class FakeTranslationDelegate extends TranslationDelegate { - public function translateProject(Program $project, ?string $source_language, string $target_language): ?array + public function translateProject(Project $project, ?string $source_language, string $target_language): ?array { $cached_result = $this->getCachedProjectTranslation($project, $source_language, $target_language); if (null !== $cached_result) { diff --git a/src/Translation/MachineTranslationEventSubscriber.php b/src/Translation/MachineTranslationEventSubscriber.php index 197f7330fb..c29379ed06 100644 --- a/src/Translation/MachineTranslationEventSubscriber.php +++ b/src/Translation/MachineTranslationEventSubscriber.php @@ -2,7 +2,7 @@ namespace App\Translation; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\Translation\CommentMachineTranslation; use App\DB\Entity\Translation\ProjectMachineTranslation; use App\DB\Entity\User\Comment\UserComment; @@ -159,7 +159,7 @@ private function findProjectAndIncrement(string $project_id, string $source_lang string $provider, string $cache = null, string $translated_name = null, string $translated_description = null, string $translated_credits = null): void { - /** @var Program|null $project */ + /** @var Project|null $project */ $project = $this->project_manager->find($project_id); if (null === $project) { diff --git a/src/Translation/TranslationDelegate.php b/src/Translation/TranslationDelegate.php index 0a7d98f95f..3c213b88dd 100644 --- a/src/Translation/TranslationDelegate.php +++ b/src/Translation/TranslationDelegate.php @@ -2,7 +2,7 @@ namespace App\Translation; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\EntityRepository\Translation\ProjectCustomTranslationRepository; use App\DB\EntityRepository\Translation\ProjectMachineTranslationRepository; use Symfony\Component\Intl\Countries; @@ -22,7 +22,7 @@ public function __construct(private readonly ProjectCustomTranslationRepository /** * @throws \InvalidArgumentException */ - public function addProjectNameCustomTranslation(Program $project, string $target_language, string $name_translation): bool + public function addProjectNameCustomTranslation(Project $project, string $target_language, string $name_translation): bool { $this->validateLanguage($target_language); @@ -32,7 +32,7 @@ public function addProjectNameCustomTranslation(Program $project, string $target /** * @throws \InvalidArgumentException */ - public function getProjectNameCustomTranslation(Program $project, string $target_language): ?string + public function getProjectNameCustomTranslation(Project $project, string $target_language): ?string { $this->validateLanguage($target_language); @@ -42,7 +42,7 @@ public function getProjectNameCustomTranslation(Program $project, string $target /** * @throws \InvalidArgumentException */ - public function deleteProjectNameCustomTranslation(Program $project, string $target_language): bool + public function deleteProjectNameCustomTranslation(Project $project, string $target_language): bool { $this->validateLanguage($target_language); @@ -52,7 +52,7 @@ public function deleteProjectNameCustomTranslation(Program $project, string $tar /** * @throws \InvalidArgumentException */ - public function addProjectDescriptionCustomTranslation(Program $project, string $target_language, string $description_translation): bool + public function addProjectDescriptionCustomTranslation(Project $project, string $target_language, string $description_translation): bool { $this->validateLanguage($target_language); @@ -62,7 +62,7 @@ public function addProjectDescriptionCustomTranslation(Program $project, string /** * @throws \InvalidArgumentException */ - public function getProjectDescriptionCustomTranslation(Program $project, string $target_language): ?string + public function getProjectDescriptionCustomTranslation(Project $project, string $target_language): ?string { $this->validateLanguage($target_language); @@ -72,7 +72,7 @@ public function getProjectDescriptionCustomTranslation(Program $project, string /** * @throws \InvalidArgumentException */ - public function deleteProjectDescriptionCustomTranslation(Program $project, string $target_language): bool + public function deleteProjectDescriptionCustomTranslation(Project $project, string $target_language): bool { $this->validateLanguage($target_language); @@ -82,7 +82,7 @@ public function deleteProjectDescriptionCustomTranslation(Program $project, stri /** * @throws \InvalidArgumentException */ - public function addProjectCreditCustomTranslation(Program $project, string $target_language, string $credit_translation): bool + public function addProjectCreditCustomTranslation(Project $project, string $target_language, string $credit_translation): bool { $this->validateLanguage($target_language); @@ -92,7 +92,7 @@ public function addProjectCreditCustomTranslation(Program $project, string $targ /** * @throws \InvalidArgumentException */ - public function getProjectCreditCustomTranslation(Program $project, string $target_language): ?string + public function getProjectCreditCustomTranslation(Project $project, string $target_language): ?string { $this->validateLanguage($target_language); @@ -102,7 +102,7 @@ public function getProjectCreditCustomTranslation(Program $project, string $targ /** * @throws \InvalidArgumentException */ - public function deleteProjectCreditCustomTranslation(Program $project, string $target_language): bool + public function deleteProjectCreditCustomTranslation(Project $project, string $target_language): bool { $this->validateLanguage($target_language); @@ -114,7 +114,7 @@ public function deleteProjectCreditCustomTranslation(Program $project, string $t * * @psalm-return array|null */ - public function translateProject(Program $project, ?string $source_language, string $target_language): ?array + public function translateProject(Project $project, ?string $source_language, string $target_language): ?array { $this->validateLanguage($source_language); $this->validateLanguage($target_language); @@ -219,7 +219,7 @@ private function validateLanguage(?string $language): void } } - protected function getCachedProjectTranslation(Program $project, ?string $source_language, string $target_language): ?array + protected function getCachedProjectTranslation(Project $project, ?string $source_language, string $target_language): ?array { return $this->project_machine_translation_repository->getCachedTranslation($project, $source_language, $target_language); } diff --git a/src/User/Achievements/AchievementManager.php b/src/User/Achievements/AchievementManager.php index fc7c2305da..d81e76d720 100644 --- a/src/User/Achievements/AchievementManager.php +++ b/src/User/Achievements/AchievementManager.php @@ -2,7 +2,7 @@ namespace App\User\Achievements; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\Achievements\Achievement; use App\DB\Entity\User\Achievements\UserAchievement; use App\DB\Entity\User\User; @@ -167,7 +167,7 @@ public function unlockAchievementBronzeUser(User $user): ?UserAchievement return null; } - if (count($user->getPrograms()) <= 0) { + if (count($user->getProjects()) <= 0) { return null; } @@ -183,8 +183,8 @@ public function unlockAchievementSilverUser(User $user): ?UserAchievement return null; } $years_with_project_uploads = []; - foreach ($user->getPrograms() as $project) { - /** @var Program $project */ + foreach ($user->getProjects() as $project) { + /** @var Project $project */ $year = $project->getUploadedAt()->format('Y'); $years_with_project_uploads[$year] = true; } @@ -204,8 +204,8 @@ public function unlockAchievementGoldUser(User $user): ?UserAchievement return null; } $years_with_project_uploads = []; - foreach ($user->getPrograms() as $project) { - /** @var Program $project */ + foreach ($user->getProjects() as $project) { + /** @var Project $project */ $year = $project->getUploadedAt()->format('Y'); $years_with_project_uploads[$year] = true; } @@ -226,8 +226,8 @@ public function unlockAchievementDiamondUser(User $user): ?UserAchievement } $years_with_project_uploads = []; - foreach ($user->getPrograms() as $project) { - /** @var Program $project */ + foreach ($user->getProjects() as $project) { + /** @var Project $project */ $year = $project->getUploadedAt()->format('Y'); $years_with_project_uploads[$year] = true; } diff --git a/src/User/UserManager.php b/src/User/UserManager.php index c57c75cec5..98f7bc4a7f 100644 --- a/src/User/UserManager.php +++ b/src/User/UserManager.php @@ -140,7 +140,7 @@ public function getActiveUserIDList(int $years): array $result = $this->entity_manager->createQueryBuilder() ->select('user.id as id') ->from(User::class, 'user') - ->leftjoin(\App\DB\Entity\Project\Program::class, 'project', Join::WITH, 'user.id = project.user') + ->leftjoin(\App\DB\Entity\Project\Project::class, 'project', Join::WITH, 'user.id = project.user') ->where('user.createdAt <= :date') ->setParameter('date', new \DateTime("-{$years} years")) ->groupBy('user.id') diff --git a/templates/Admin/CRUD/list__action_create_url_programs.html.twig b/templates/Admin/CRUD/list__action_create_url_projects.html.twig similarity index 100% rename from templates/Admin/CRUD/list__action_create_url_programs.html.twig rename to templates/Admin/CRUD/list__action_create_url_projects.html.twig diff --git a/templates/Admin/CRUD/list__action_show_reported_project_details.html.twig b/templates/Admin/CRUD/list__action_show_reported_project_details.html.twig index 327ab7e5ff..22126a5e24 100644 --- a/templates/Admin/CRUD/list__action_show_reported_project_details.html.twig +++ b/templates/Admin/CRUD/list__action_show_reported_project_details.html.twig @@ -1,2 +1,2 @@ - Show \ No newline at end of file diff --git a/templates/Admin/CRUD/list__action_show_user_data.html.twig b/templates/Admin/CRUD/list__action_show_user_data.html.twig index f86a3c7dbd..ba7ba3a9fa 100644 --- a/templates/Admin/CRUD/list__action_show_user_data.html.twig +++ b/templates/Admin/CRUD/list__action_show_user_data.html.twig @@ -131,7 +131,7 @@
Note
{{ pir.note }}
Time
{{ pir.time|date('Y-m-d h:m:s') }}
State
{{ pir.state }}
-
Project
{{ pir.program }}
+
Project
{{ pir.project }}
Project Version
{{ pir.projectVersion }}
{% endfor %} @@ -145,7 +145,7 @@ {% for uc in user_comments %}
ID
{{ uc.id }}
-
Project
{{ uc.program }}
+
Project
{{ uc.project }}
User ID
{{ uc.user.id }}
User name
{{ uc.userName }}
Uploaded at
{{ uc.uploadDate|date('Y-m-d h:m:s') }}
@@ -182,8 +182,8 @@ {% if notification.follower is defined %}
Follower
{{ notification.follower }}
{% endif %} - {% if notification.program is defined %} -
Project
{{ notification.program }}
+ {% if notification.project is defined %} +
Project
{{ notification.project }}
{% endif %}
{% endfor %} diff --git a/templates/Admin/DB_Updater/admin_extensions.html.twig b/templates/Admin/DB_Updater/admin_extensions.html.twig index fac852a041..df59bc6f62 100644 --- a/templates/Admin/DB_Updater/admin_extensions.html.twig +++ b/templates/Admin/DB_Updater/admin_extensions.html.twig @@ -14,7 +14,7 @@
  1. Add/modify the extensions in `UpdateProjectExtensionsCommand.php`
  2. Add all necessary new translations
  3. -
  4. Add logic to `ProgramExtensionListener.php`
  5. +
  6. Add logic to `ProjectExtensionListener.php`
  7. Trigger the update into the database
diff --git a/templates/Notifications/NotificationTypes/comment_notification.html.twig b/templates/Notifications/NotificationTypes/comment_notification.html.twig index c868e7c77c..60d4b419e2 100644 --- a/templates/Notifications/NotificationTypes/comment_notification.html.twig +++ b/templates/Notifications/NotificationTypes/comment_notification.html.twig @@ -17,7 +17,7 @@ ( { '%user_link%': ''~notification.comment.username|escape~'', - '%program_link%': ''~notification.comment.program.name|escape~'' + '%program_link%': ''~notification.comment.project.name|escape~'' }, 'catroweb' ) diff --git a/templates/Notifications/NotificationTypes/like_notification.html.twig b/templates/Notifications/NotificationTypes/like_notification.html.twig index d247c1f606..06c689fd77 100644 --- a/templates/Notifications/NotificationTypes/like_notification.html.twig +++ b/templates/Notifications/NotificationTypes/like_notification.html.twig @@ -17,7 +17,7 @@ ( { '%user_link%': ''~notification.getLikeFrom.getUserName|escape~'', - '%program_link%': ''~notification.program.name|escape~'' + '%program_link%': ''~notification.project.name|escape~'' }, 'catroweb' ) diff --git a/templates/Notifications/NotificationTypes/new_project_notification.html.twig b/templates/Notifications/NotificationTypes/new_project_notification.html.twig index abb0ac2ac9..c9018b99d3 100644 --- a/templates/Notifications/NotificationTypes/new_project_notification.html.twig +++ b/templates/Notifications/NotificationTypes/new_project_notification.html.twig @@ -2,9 +2,9 @@ {% block notification_leftAvatar %}
- + @@ -16,8 +16,8 @@ {{ 'catro-notifications.project-upload.message' | trans ( { - '%user_link%': ''~notification.program.user.username|escape~'', - '%program_link%': ''~notification.program.name|escape~'' + '%user_link%': ''~notification.project.user.username|escape~'', + '%program_link%': ''~notification.project.name|escape~'' }, 'catroweb' ) diff --git a/templates/Notifications/NotificationTypes/remix_notification.html.twig b/templates/Notifications/NotificationTypes/remix_notification.html.twig index 4b33950dbf..a3f851e07e 100644 --- a/templates/Notifications/NotificationTypes/remix_notification.html.twig +++ b/templates/Notifications/NotificationTypes/remix_notification.html.twig @@ -17,8 +17,8 @@ ( { '%user_link%': ''~notification.getRemixFrom.getUserName|escape~'', - '%program_link%': ''~notification.getRemixProgram.name|escape~'', - '%remix_program_link%': ''~notification.program.name|escape~'' + '%program_link%': ''~notification.getRemixProject.name|escape~'', + '%remix_program_link%': ''~notification.project.name|escape~'' }, 'catroweb' ) diff --git a/templates/Project/project.html.twig b/templates/Project/project.html.twig index 4f819c0e51..62dd30c27f 100644 --- a/templates/Project/project.html.twig +++ b/templates/Project/project.html.twig @@ -226,8 +226,8 @@ data-trans-update-app-header="{{ 'project.updateAppHeader'|trans({}, "catroweb") }}" data-trans-update-app-text="{{ 'project.updateAppText'|trans({}, "catroweb") }}" data-trans-btn-close="{{ 'project.btnClosePopup'|trans({}, "catroweb") }}" - data-const-action-add="{{ constant('App\\DB\\Entity\\Project\\ProgramLike::ACTION_ADD') }}" - data-const-action-remove="{{ constant('App\\DB\\Entity\\Project\\ProgramLike::ACTION_REMOVE') }}" + data-const-action-add="{{ constant('App\\DB\\Entity\\Project\\ProjectLike::ACTION_ADD') }}" + data-const-action-remove="{{ constant('App\\DB\\Entity\\Project\\ProjectLike::ACTION_REMOVE') }}" data-path-profile="{{ path('profile', {'id': 'USERID'}) }}" data-asset-wow-white="{{ asset('images/default/wow_white.svg') }}" data-asset-wow-black="{{ asset('images/default/wow_black.svg') }}" diff --git a/templates/Project/project_description.html.twig b/templates/Project/project_description.html.twig index 8b2f360e95..b5c5413990 100644 --- a/templates/Project/project_description.html.twig +++ b/templates/Project/project_description.html.twig @@ -16,11 +16,11 @@ {{ "credits"|trans({}, "catroweb") }}
- {% if (project.credits or project.isScratchProgram()) %} + {% if (project.credits or project.isScratchProject()) %} {% if project.credits %} {{ project.credits|nl2br }} {% endif %} - {% if project.isScratchProgram() %} + {% if project.isScratchProject() %} {{ "projectImportedFromScratch"|trans({}, "catroweb") }} {{ "scratchImportedProjectLinkHere"|trans({}, "catroweb") }} diff --git a/templates/Project/project_reactions.html.twig b/templates/Project/project_reactions.html.twig index b5ee0d10a0..140f66055d 100644 --- a/templates/Project/project_reactions.html.twig +++ b/templates/Project/project_reactions.html.twig @@ -12,28 +12,28 @@ {% else %}
- {% if constant('App\\DB\\Entity\\Project\\ProgramLike::TYPE_THUMBS_UP') in project_details.activeLikeTypes %} + {% if constant('App\\DB\\Entity\\Project\\ProjectLike::TYPE_THUMBS_UP') in project_details.activeLikeTypes %}
thumb_up
{% endif %} - {% if constant('App\\DB\\Entity\\Project\\ProgramLike::TYPE_SMILE') in project_details.activeLikeTypes %} + {% if constant('App\\DB\\Entity\\Project\\ProjectLike::TYPE_SMILE') in project_details.activeLikeTypes %}
sentiment_very_satisfied
{% endif %} - {% if constant('App\\DB\\Entity\\Project\\ProgramLike::TYPE_LOVE') in project_details.activeLikeTypes %} + {% if constant('App\\DB\\Entity\\Project\\ProjectLike::TYPE_LOVE') in project_details.activeLikeTypes %}
favorite
{% endif %} - {% if constant('App\\DB\\Entity\\Project\\ProgramLike::TYPE_WOW') in project_details.activeLikeTypes %} + {% if constant('App\\DB\\Entity\\Project\\ProjectLike::TYPE_WOW') in project_details.activeLikeTypes %}
Wow reaction
@@ -61,8 +61,8 @@ {# Thumbs-Up Button #}
thumb_up @@ -71,8 +71,8 @@ {# Smile Button #}
sentiment_very_satisfied @@ -81,8 +81,8 @@ {# Love Button #}
favorite @@ -91,8 +91,8 @@ {# Wow Button #}
Wow reaction
diff --git a/templates/UserManagement/Profile/accountSettings.html.twig b/templates/UserManagement/Profile/accountSettings.html.twig index 5fbdb95a9d..8f8a47b310 100644 --- a/templates/UserManagement/Profile/accountSettings.html.twig +++ b/templates/UserManagement/Profile/accountSettings.html.twig @@ -14,7 +14,7 @@ {% block content %}

{{ 'myprofile.deleteAccount'|trans({}, 'catroweb') }}

{% set text_parts = 'myprofile.deleteAccountWarning' - |trans({'%num_projects%': app.user.programs|length, '%num_followers%': app.user.followers|length}, 'catroweb') + |trans({'%num_projects%': app.user.projects|length, '%num_followers%': app.user.followers|length}, 'catroweb') |split('\n') %}

{{ text_parts[0] }} {{ text_parts[1] }}

diff --git a/tests/BehatFeatures/api-deprecated/general/flavor_detection.feature b/tests/BehatFeatures/api-deprecated/general/flavor_detection.feature index 9a41f255c7..8f67b66593 100644 --- a/tests/BehatFeatures/api-deprecated/general/flavor_detection.feature +++ b/tests/BehatFeatures/api-deprecated/general/flavor_detection.feature @@ -1,15 +1,15 @@ -Feature: Flag programs based on the app flavor +Feature: Flag projects based on the app flavor - In order provide an index of different flavored programs + In order provide an index of different flavored projects As a site owner - I want to be able to automatically flag programs by their flavor + I want to be able to automatically flag projects by their flavor - Scenario: Flag a program uploaded with the phiro app + Scenario: Flag a project uploaded with the phiro app When I upload a catrobat project with the phiro app Then the project should be flagged as phiro - Scenario: Do not flag a program as phiro if uploaded with pocketcode + Scenario: Do not flag a project as phiro if uploaded with pocketcode When I upload a standard catrobat project Then the project should not be flagged as phiro diff --git a/tests/BehatFeatures/api-deprecated/general/flavor_filter.feature b/tests/BehatFeatures/api-deprecated/general/flavor_filter.feature index 13edfe072a..3612236bf7 100644 --- a/tests/BehatFeatures/api-deprecated/general/flavor_filter.feature +++ b/tests/BehatFeatures/api-deprecated/general/flavor_filter.feature @@ -1,8 +1,8 @@ -Feature: Filtering programs with specific flavor +Feature: Filtering projects with specific flavor - In order provide an index of different flavored programs + In order provide an index of different flavored projects As a site owner - I want to see only programs with my flavor + I want to see only projects with my flavor Background: Given there are projects: @@ -17,7 +17,7 @@ Feature: Filtering programs with specific flavor | Test game | pocketcode | - Scenario: Get most viewed programs of flavor pocketcode + Scenario: Get most viewed projects of flavor pocketcode When I get the most viewed projects with "app/api/projects/mostViewed.json" Then I should get following projects: @@ -31,7 +31,7 @@ Feature: Filtering programs with specific flavor | Amazing race | | Test game | - Scenario: Get most viewed programs of flavor luna + Scenario: Get most viewed projects of flavor luna When I get the most viewed projects with "luna/api/projects/mostViewed.json" Then I should get following projects: @@ -45,7 +45,7 @@ Feature: Filtering programs with specific flavor | Amazing race | | Test game | - Scenario: Get most downloaded programs of pocketcode + Scenario: Get most downloaded projects of pocketcode When I get the most downloaded projects with "app/api/projects/mostDownloaded.json" Then I should get following projects: @@ -59,7 +59,7 @@ Feature: Filtering programs with specific flavor | Amazing race | | Test game | - Scenario: Get most downloaded programs of flavor luna + Scenario: Get most downloaded projects of flavor luna When I get the most downloaded projects with "luna/api/projects/mostDownloaded.json" Then I should get following projects: @@ -73,7 +73,7 @@ Feature: Filtering programs with specific flavor | Amazing race | | Test game | - Scenario: Get recent programs of flavor pocketcode + Scenario: Get recent projects of flavor pocketcode When I get the recent projects with "app/api/projects/recent.json" Then I should get following projects: @@ -87,7 +87,7 @@ Feature: Filtering programs with specific flavor | Amazing race | | Test game | - Scenario: Get recent programs of flavor luna + Scenario: Get recent projects of flavor luna When I get the recent projects with "luna/api/projects/recent.json" Then I should get following projects: @@ -104,7 +104,7 @@ Feature: Filtering programs with specific flavor | New adventure | | Amazing race | - Scenario: Get all programs of a user no matter the flavor (pocketcode) + Scenario: Get all projects of a user no matter the flavor (pocketcode) Given I get the user's projects with "app/api/projects/userProjects.json" Then I should get following projects: @@ -118,7 +118,7 @@ Feature: Filtering programs with specific flavor | Amazing race | | Test game | - Scenario: Get all programs of a user no matter the flavor (luna) + Scenario: Get all projects of a user no matter the flavor (luna) Given I get the user's projects with "luna/api/projects/userProjects.json" Then I should get following projects: diff --git a/tests/BehatFeatures/api-deprecated/general/search.feature b/tests/BehatFeatures/api-deprecated/general/search.feature index 92f2c5bff3..be50e5d627 100644 --- a/tests/BehatFeatures/api-deprecated/general/search.feature +++ b/tests/BehatFeatures/api-deprecated/general/search.feature @@ -1,5 +1,5 @@ @api @search -Feature: Search programs +Feature: Search projects Background: Given there are users: @@ -23,7 +23,7 @@ Feature: Search programs And the server name is "pocketcode.org" And I wait 1000 milliseconds - Scenario: Search for a program + Scenario: Search for a project Given the HTTP Request: | Method | GET | @@ -65,7 +65,7 @@ Feature: Search programs } """ - Scenario: No programs are found + Scenario: No projects are found When searching for "NOTHINGTOBEFIOUND" Then I should get the json object: diff --git a/tests/BehatFeatures/api-deprecated/general/search_extension_programs.feature b/tests/BehatFeatures/api-deprecated/general/search_extension_projects.feature similarity index 87% rename from tests/BehatFeatures/api-deprecated/general/search_extension_programs.feature rename to tests/BehatFeatures/api-deprecated/general/search_extension_projects.feature index 832365ce86..d4295a31f4 100644 --- a/tests/BehatFeatures/api-deprecated/general/search_extension_programs.feature +++ b/tests/BehatFeatures/api-deprecated/general/search_extension_projects.feature @@ -1,7 +1,7 @@ @api -Feature: Search extensions programs +Feature: Search extensions projects - To find programs, users should be able to search all available programs for specific words and extensions + To find projects, users should be able to search all available projects for specific words and extensions Background: Given there are users: @@ -33,7 +33,7 @@ Feature: Search extensions programs | Minions | - Scenario: Search more programs with the same extension over the normal search + Scenario: Search more projects with the same extension over the normal search Given I use the limit "10" And I use the offset "0" diff --git a/tests/BehatFeatures/api-deprecated/general/search_programs.feature b/tests/BehatFeatures/api-deprecated/general/search_projects.feature similarity index 92% rename from tests/BehatFeatures/api-deprecated/general/search_programs.feature rename to tests/BehatFeatures/api-deprecated/general/search_projects.feature index f372f8c13d..5cb8a573aa 100644 --- a/tests/BehatFeatures/api-deprecated/general/search_programs.feature +++ b/tests/BehatFeatures/api-deprecated/general/search_projects.feature @@ -1,7 +1,7 @@ @api -Feature: Search programs +Feature: Search projects - To find programs, users should be able to search all available programs for specific words + To find projects, users should be able to search all available projects for specific words Background: Given there are users: @@ -71,7 +71,7 @@ Feature: Search programs """ - Scenario: Search for a program with a certain name + Scenario: Search for a project with a certain name When I search for "Minions" Then I should get following projects: @@ -107,7 +107,7 @@ Feature: Search programs """ - Scenario: search program by description + Scenario: search project by description Given I use the limit "10" When I search for "description1" @@ -117,7 +117,7 @@ Feature: Search programs | Superponny | - Scenario: search program by description + Scenario: search project by description Given I use the limit "10" When I search for "description2" @@ -127,7 +127,7 @@ Feature: Search programs | Superponny | - Scenario: searching using the AND relation between the words should only show related programs + Scenario: searching using the AND relation between the words should only show related projects Given I use the limit "10" When I search for "description1 description2" @@ -135,7 +135,7 @@ Feature: Search programs | name | | Superponny | - Scenario: if the query matches in title and description, return the program with the matching title first + Scenario: if the query matches in title and description, return the project with the matching title first Given I use the limit "10" When I search for "Universe" @@ -156,7 +156,7 @@ Feature: Search programs | Search | Limit | Offset | TotalProjects | | Marko | 5 | 0 | 2 | - Scenario: find a program with its id + Scenario: find a project with its id Given I use the limit "10" And I use the offset "0" @@ -165,7 +165,7 @@ Feature: Search programs | name | | Universe | - Scenario: find a program with its id + Scenario: find a project with its id Given I use the limit "10" And I use the offset "0" @@ -174,7 +174,7 @@ Feature: Search programs | name | | Minions | - Scenario: find a program with its id + Scenario: find a project with its id Given I use the limit "10" And I use the offset "0" @@ -183,7 +183,7 @@ Feature: Search programs | name | | Minions | - Scenario: only show visible programs + Scenario: only show visible projects Given project "Ponny" is not visible And I wait 1000 milliseconds And I use the limit "10" diff --git a/tests/BehatFeatures/api-deprecated/general/search_tagged_programs.feature b/tests/BehatFeatures/api-deprecated/general/search_tagged_projects.feature similarity index 93% rename from tests/BehatFeatures/api-deprecated/general/search_tagged_programs.feature rename to tests/BehatFeatures/api-deprecated/general/search_tagged_projects.feature index 3da3dba737..b0e1cdf778 100644 --- a/tests/BehatFeatures/api-deprecated/general/search_tagged_programs.feature +++ b/tests/BehatFeatures/api-deprecated/general/search_tagged_projects.feature @@ -1,7 +1,7 @@ @api -Feature: Search tagged programs +Feature: Search tagged projects - To find programs, users should be able to search all available programs for specific words and tags + To find projects, users should be able to search all available projects for specific words and tags Background: Given there are users: @@ -52,7 +52,7 @@ Feature: Search tagged programs | name | | Minions | - Scenario: Search more programs with the same tag over the normal search + Scenario: Search more projects with the same tag over the normal search Given I use the limit "10" And I use the offset "0" @@ -62,7 +62,7 @@ Feature: Search tagged programs | Galaxy | | Minions | - Scenario: Search a program with the tag over the normal search + Scenario: Search a project with the tag over the normal search When I search for "Single" Then I should get following projects: diff --git a/tests/BehatFeatures/api-deprecated/profile/check_token.feature b/tests/BehatFeatures/api-deprecated/profile/check_token.feature index ba783d2f7d..c3cfab6cdc 100644 --- a/tests/BehatFeatures/api-deprecated/profile/check_token.feature +++ b/tests/BehatFeatures/api-deprecated/profile/check_token.feature @@ -8,9 +8,9 @@ Feature: Checking a user's token validity | User1 | vwxyz | aaaaaaaaaa | 2 | And there are projects: | id | name | description | owned by | downloads | views | upload time | version | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | - | 2 | program 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | - | 3 | program 3 | | User1 | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | + | 2 | project 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | + | 3 | project 3 | | User1 | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | Scenario Outline: Checking the current token Given I have a parameter "username" with value "" diff --git a/tests/BehatFeatures/api-deprecated/profile/recsys_user_similarity_computation.feature b/tests/BehatFeatures/api-deprecated/profile/recsys_user_similarity_computation.feature index 4524f416a0..bee67ca189 100644 --- a/tests/BehatFeatures/api-deprecated/profile/recsys_user_similarity_computation.feature +++ b/tests/BehatFeatures/api-deprecated/profile/recsys_user_similarity_computation.feature @@ -3,7 +3,7 @@ Feature: Computes user similarities by analyzing common likes and remixes betwee (user-based Collaborative Filtering using Jaccard distance as similarity measure) The results of the computed similarities are later used by the recommendation algorithm. - See tests: get_recommended_programs_homepage.feature + See tests: get_recommended_projects_homepage.feature Scenario: We don't have the import_*.sql files anymore Then We can't test anything here @@ -29,7 +29,7 @@ Feature: Computes user similarities by analyzing common likes and remixes betwee # # Scenario: Example #1, only one like-similarity # Given there are likes: -# | username | program_id | type | created at | +# | username | project_id | type | created at | # | Catrobat1 | 1 | 1 | 01.01.2017 12:00 | # | Catrobat2 | 1 | 1 | 01.01.2017 12:00 | # | Catrobat2 | 2 | 3 | 01.01.2017 12:00 | @@ -42,7 +42,7 @@ Feature: Computes user similarities by analyzing common likes and remixes betwee # # Scenario: Example #2, like-similarities between multiple users # Given there are likes: -# | username | program_id | type | created at | +# | username | project_id | type | created at | # | Catrobat1 | 1 | 1 | 01.01.2017 12:00 | # | Catrobat2 | 1 | 1 | 01.01.2017 12:00 | # | Catrobat2 | 2 | 3 | 01.01.2017 12:00 | diff --git a/tests/BehatFeatures/api-deprecated/project/download_program.feature b/tests/BehatFeatures/api-deprecated/project/download_project.feature similarity index 84% rename from tests/BehatFeatures/api-deprecated/project/download_program.feature rename to tests/BehatFeatures/api-deprecated/project/download_project.feature index a94a4af69b..cf5578e8ef 100644 --- a/tests/BehatFeatures/api-deprecated/project/download_program.feature +++ b/tests/BehatFeatures/api-deprecated/project/download_project.feature @@ -1,5 +1,5 @@ @api -Feature: Download programs +Feature: Download projects Background: Given there are users: @@ -7,8 +7,8 @@ Feature: Download programs | Catrobat | 12345 | cccccccccc | 1 | And there are downloadable projects: | id | name | description | owned by | downloads | views | upload time | version | visible | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | - | 2 | program 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | + | 2 | project 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | Scenario: Projects can be downloaded When I download "/app/download/1.catrobat" diff --git a/tests/BehatFeatures/api-deprecated/project/get_featured_programs.feature b/tests/BehatFeatures/api-deprecated/project/get_featured_projects.feature similarity index 95% rename from tests/BehatFeatures/api-deprecated/project/get_featured_programs.feature rename to tests/BehatFeatures/api-deprecated/project/get_featured_projects.feature index 0a762bf27b..57e4491248 100644 --- a/tests/BehatFeatures/api-deprecated/project/get_featured_programs.feature +++ b/tests/BehatFeatures/api-deprecated/project/get_featured_projects.feature @@ -1,5 +1,5 @@ @api -Feature: Get featured ios programs (deprecated) +Feature: Get featured ios projects (deprecated) Background: Given the server name is "pocketcode.org" @@ -25,7 +25,7 @@ Feature: Get featured ios programs (deprecated) | IOS test | 1 | 0 | yes | | Mega Game1 | 0 | 1 | yes | - Scenario: show featured programs without limit and offset + Scenario: show featured projects without limit and offset When I GET "/app/api/projects/ios-featured.json" with these parameters Then I should get the json object: """ diff --git a/tests/BehatFeatures/api-deprecated/project/get_most_downloaded_programs.feature b/tests/BehatFeatures/api-deprecated/project/get_most_downloaded_projects.feature similarity index 78% rename from tests/BehatFeatures/api-deprecated/project/get_most_downloaded_programs.feature rename to tests/BehatFeatures/api-deprecated/project/get_most_downloaded_projects.feature index a55187981a..38f4b1ff76 100644 --- a/tests/BehatFeatures/api-deprecated/project/get_most_downloaded_programs.feature +++ b/tests/BehatFeatures/api-deprecated/project/get_most_downloaded_projects.feature @@ -1,5 +1,5 @@ @api -Feature: Get the most downloaded programs +Feature: Get the most downloaded projects Background: Given there are users: @@ -8,13 +8,13 @@ Feature: Get the most downloaded programs | User1 | vwxyz | aaaaaaaaaa | 2 | And there are projects: | id | name | description | owned by | downloads | views | upload time | version | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | - | 2 | program 2 | | Catrobat | 333 | 9 | 22.04.2014 13:00 | 0.8.5 | - | 3 | program 3 | | User1 | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | + | 2 | project 2 | | Catrobat | 333 | 9 | 22.04.2014 13:00 | 0.8.5 | + | 3 | project 3 | | User1 | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | And the current time is "01.08.2014 13:00" - Scenario: show most downloaded programs + Scenario: show most downloaded projects Given I have a parameter "limit" with value "1" And I have a parameter "offset" with value "0" When I GET "/app/api/projects/mostDownloaded.json" with these parameters @@ -23,8 +23,8 @@ Feature: Get the most downloaded programs { "CatrobatProjects":[{ "ProjectId": "REGEX_STRING_WILDCARD", - "ProjectName":"program 2", - "ProjectNameShort":"program 2", + "ProjectName":"project 2", + "ProjectNameShort":"project 2", "Author":"Catrobat", "Description":"", "Version":"0.8.5", @@ -49,29 +49,29 @@ Feature: Get the most downloaded programs } """ - Scenario: show most downloaded programs with limit and offset + Scenario: show most downloaded projects with limit and offset Given I have a parameter "limit" with value "2" And I have a parameter "offset" with value "0" When I GET "/app/api/projects/mostDownloaded.json" with these parameters Then I should get projects in the following order: | Name | - | program 2 | - | program 3 | + | project 2 | + | project 3 | - Scenario: show most downloaded programs with limit and offset + Scenario: show most downloaded projects with limit and offset Given I have a parameter "limit" with value "2" And I have a parameter "offset" with value "1" When I GET "/app/api/projects/mostDownloaded.json" with these parameters Then I should get projects in the following order: | Name | - | program 3 | - | program 1 | + | project 3 | + | project 1 | - Scenario: show only visible programs - Given project "program 2" is not visible + Scenario: show only visible projects + Given project "project 2" is not visible When I GET "/app/api/projects/mostDownloaded.json" with these parameters Then I should get projects in the following order: | Name | - | program 3 | - | program 1 | + | project 3 | + | project 1 | \ No newline at end of file diff --git a/tests/BehatFeatures/api-deprecated/project/get_most_viewed_programs.feature b/tests/BehatFeatures/api-deprecated/project/get_most_viewed_projects.feature similarity index 78% rename from tests/BehatFeatures/api-deprecated/project/get_most_viewed_programs.feature rename to tests/BehatFeatures/api-deprecated/project/get_most_viewed_projects.feature index 2e16191472..7a97ed62cc 100644 --- a/tests/BehatFeatures/api-deprecated/project/get_most_viewed_programs.feature +++ b/tests/BehatFeatures/api-deprecated/project/get_most_viewed_projects.feature @@ -1,5 +1,5 @@ @api -Feature: Get the most downloaded programs +Feature: Get the most downloaded projects Background: Given there are users: @@ -8,12 +8,12 @@ Feature: Get the most downloaded programs | User1 | vwxyz | aaaaaaaaaa | 2 | And there are projects: | id | name | description | owned by | downloads | views | upload time | version | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | - | 2 | program 2 | | Catrobat | 333 | 90 | 01.02.2013 13:00 | 0.8.5 | - | 3 | program 3 | | User1 | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | + | 2 | project 2 | | Catrobat | 333 | 90 | 01.02.2013 13:00 | 0.8.5 | + | 3 | project 3 | | User1 | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | And the current time is "01.08.2014 13:00" - Scenario: show most viewed programs + Scenario: show most viewed projects Given I have a parameter "limit" with value "1" And I have a parameter "offset" with value "0" When I GET "/app/api/projects/mostViewed.json" with these parameters @@ -22,8 +22,8 @@ Feature: Get the most downloaded programs { "CatrobatProjects":[{ "ProjectId": "REGEX_STRING_WILDCARD", - "ProjectName":"program 2", - "ProjectNameShort":"program 2", + "ProjectName":"project 2", + "ProjectNameShort":"project 2", "Author":"Catrobat", "Description":"", "Version":"0.8.5", @@ -48,29 +48,29 @@ Feature: Get the most downloaded programs } """ - Scenario: show most downloaded programs with limit and offset + Scenario: show most downloaded projects with limit and offset Given I have a parameter "limit" with value "2" And I have a parameter "offset" with value "0" When I GET "/app/api/projects/mostViewed.json" with these parameters Then I should get projects in the following order: | Name | - | program 2 | - | program 3 | + | project 2 | + | project 3 | - Scenario: show most downloaded programs with limit and offset + Scenario: show most downloaded projects with limit and offset Given I have a parameter "limit" with value "2" And I have a parameter "offset" with value "1" When I GET "/app/api/projects/mostViewed.json" with these parameters Then I should get projects in the following order: | Name | - | program 3 | - | program 1 | + | project 3 | + | project 1 | - Scenario: show only visible programs - Given project "program 3" is not visible + Scenario: show only visible projects + Given project "project 3" is not visible When I GET "/app/api/projects/mostViewed.json" with these parameters Then I should get projects in the following order: | Name | - | program 2 | - | program 1 | + | project 2 | + | project 1 | diff --git a/tests/BehatFeatures/api-deprecated/project/get_random_programs.feature b/tests/BehatFeatures/api-deprecated/project/get_random_projects.feature similarity index 74% rename from tests/BehatFeatures/api-deprecated/project/get_random_programs.feature rename to tests/BehatFeatures/api-deprecated/project/get_random_projects.feature index b4aec3ecf5..c9ba943be9 100644 --- a/tests/BehatFeatures/api-deprecated/project/get_random_programs.feature +++ b/tests/BehatFeatures/api-deprecated/project/get_random_projects.feature @@ -1,5 +1,5 @@ @api -Feature: Get the random programs +Feature: Get the random projects Background: Given there are users: @@ -9,38 +9,38 @@ Feature: Get the random programs | User2 | vwxyz | aaaaaaaaaa | 3 | And there are projects: | id | name | description | owned by | downloads | views | upload time | version | visible | - | 1 | program 1 | p1 | Catrobat | 1 | 4 | 01.01.2013 12:00 | 0.8.5 | true | - | 2 | program 2 | p2 | Catrobat | 2 | 3 | 01.02.2013 13:00 | 0.8.5 | false | - | 3 | program 3 | p3 | User1 | 3 | 2 | 01.03.2012 14:00 | 0.8.5 | false | - | 4 | program 4 | p4 | User2 | 4 | 1 | 01.04.2012 15:00 | 0.8.5 | true | + | 1 | project 1 | p1 | Catrobat | 1 | 4 | 01.01.2013 12:00 | 0.8.5 | true | + | 2 | project 2 | p2 | Catrobat | 2 | 3 | 01.02.2013 13:00 | 0.8.5 | false | + | 3 | project 3 | p3 | User1 | 3 | 2 | 01.03.2012 14:00 | 0.8.5 | false | + | 4 | project 4 | p4 | User2 | 4 | 1 | 01.04.2012 15:00 | 0.8.5 | true | And the current time is "01.08.2014 13:00" - Scenario: show random programs + Scenario: show random projects Given I have a parameter "limit" with value "2" And I have a parameter "offset" with value "0" When I GET "/app/api/projects/randomProjects.json" with these parameters Then I should get 2 projects in random order: | Name | - | program 1 | - | program 4 | + | project 1 | + | project 4 | - Scenario: show random program with offset + Scenario: show random project with offset Given I have a parameter "limit" with value "1" And I have a parameter "offset" with value "0" When I GET "/app/api/projects/randomProjects.json" with these parameters Then I should get 1 projects in random order: | Name | - | program 1 | - | program 4 | + | project 1 | + | project 4 | And I have a parameter "offset" with value "1" When I GET "/app/api/projects/randomProjects.json" with these parameters Then I should get 1 projects in random order: | Name | - | program 1 | - | program 4 | + | project 1 | + | project 4 | And I have a parameter "offset" with value "2" When I GET "/app/api/projects/randomProjects.json" with these parameters Then I should get 0 projects in random order: | Name | - | program 1 | - | program 4 | \ No newline at end of file + | project 1 | + | project 4 | \ No newline at end of file diff --git a/tests/BehatFeatures/api-deprecated/project/get_recent_programs.feature b/tests/BehatFeatures/api-deprecated/project/get_recent_projects.feature similarity index 76% rename from tests/BehatFeatures/api-deprecated/project/get_recent_programs.feature rename to tests/BehatFeatures/api-deprecated/project/get_recent_projects.feature index f5d6827db1..5f7dd152b4 100644 --- a/tests/BehatFeatures/api-deprecated/project/get_recent_programs.feature +++ b/tests/BehatFeatures/api-deprecated/project/get_recent_projects.feature @@ -1,5 +1,5 @@ @api -Feature: Get the most recent programs +Feature: Get the most recent projects Background: Given there are users: @@ -8,12 +8,12 @@ Feature: Get the most recent programs | User1 | vwxyz | aaaaaaaaaa | 2 | And there are projects: | id | name | description | owned by | downloads | views | upload time | version | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | - | 2 | program 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | - | 3 | program 3 | | User1 | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | + | 2 | project 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | + | 3 | project 3 | | User1 | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | And the current time is "01.08.2014 13:00" - Scenario: show recent programs + Scenario: show recent projects Given I have a parameter "limit" with value "1" And I have a parameter "offset" with value "0" When I GET "/app/api/projects/recent.json" with these parameters @@ -22,8 +22,8 @@ Feature: Get the most recent programs { "CatrobatProjects":[{ "ProjectId": "REGEX_STRING_WILDCARD", - "ProjectName":"program 2", - "ProjectNameShort":"program 2", + "ProjectName":"project 2", + "ProjectNameShort":"project 2", "Author":"Catrobat", "Description":"", "Version":"0.8.5", @@ -48,29 +48,29 @@ Feature: Get the most recent programs } """ - Scenario: show recent programs with limit and offset + Scenario: show recent projects with limit and offset When I get the most recent projects with limit "2" and offset "0" Then I should get projects in the following order: | Name | - | program 2 | - | program 1 | + | project 2 | + | project 1 | - Scenario: show recent programs with limit and offset + Scenario: show recent projects with limit and offset When I get the most recent projects with limit "3" and offset "1" Then I should get projects in the following order: | Name | - | program 1 | - | program 3 | + | project 1 | + | project 3 | - Scenario: show only visible programs - Given project "program 1" is not visible + Scenario: show only visible projects + Given project "project 1" is not visible When I get the most recent projects Then I should get projects in the following order: | Name | - | program 2 | - | program 3 | + | project 2 | + | project 3 | - Scenario: show recent programs after uploading a new program + Scenario: show recent projects after uploading a new project Given I am "Catrobat" And I have a project with "name" set to "WebTeam" When I upload this generated project, API version 1 @@ -78,11 +78,11 @@ Feature: Get the most recent programs Then I should get projects in the following order: | Name | | WebTeam | - | program 2 | - | program 1 | - | program 3 | + | project 2 | + | project 1 | + | project 3 | - Scenario: show recent programs after updating an existing program + Scenario: show recent projects after updating an existing project Given I am "Catrobat" And I upload the project with "WebTeam" as name, API version 1 And I upload the project with "WebTeamV2" as name, API version 1 @@ -92,6 +92,6 @@ Feature: Get the most recent programs | Name | | WebTeam | | WebTeamV2 | - | program 2 | - | program 1 | - | program 3 | + | project 2 | + | project 1 | + | project 3 | diff --git a/tests/BehatFeatures/api-deprecated/project/get_user_programs.feature b/tests/BehatFeatures/api-deprecated/project/get_user_projects.feature similarity index 96% rename from tests/BehatFeatures/api-deprecated/project/get_user_programs.feature rename to tests/BehatFeatures/api-deprecated/project/get_user_projects.feature index 01a84c2afe..25bcefa080 100644 --- a/tests/BehatFeatures/api-deprecated/project/get_user_programs.feature +++ b/tests/BehatFeatures/api-deprecated/project/get_user_projects.feature @@ -1,7 +1,7 @@ @api -Feature: Get users programs +Feature: Get users projects - Get the programs from a specific user + Get the projects from a specific user Background: Given there are users: @@ -24,7 +24,7 @@ Feature: Get users programs And the current time is "01.08.2014 13:00" - Scenario: show user programs + Scenario: show user projects Given I have a parameter "user_id" with value "1" When I GET "/app/api/projects/userProjects.json" with these parameters Then I should get the json object: @@ -83,13 +83,13 @@ Feature: Get users programs | Name | | MarkoTheBest | - Scenario: empty result set is returend if the user doesnt exist or has no programs + Scenario: empty result set is returend if the user doesnt exist or has no projects Given I have a parameter "user_id" with value "5" When I GET "/app/api/projects/userProjects.json" with these parameters Then I should get projects in the following order: | Name | - Scenario: show only visible programs + Scenario: show only visible projects Given project "MarkoTheBest" is not visible And I have a parameter "user_id" with value "3" When I GET "/app/api/projects/userProjects.json" with these parameters diff --git a/tests/BehatFeatures/api-deprecated/project/list_programs_debug_build.feature b/tests/BehatFeatures/api-deprecated/project/list_projects_debug_build.feature similarity index 72% rename from tests/BehatFeatures/api-deprecated/project/list_programs_debug_build.feature rename to tests/BehatFeatures/api-deprecated/project/list_projects_debug_build.feature index 8d06d1a9f7..a4d5d28c06 100644 --- a/tests/BehatFeatures/api-deprecated/project/list_programs_debug_build.feature +++ b/tests/BehatFeatures/api-deprecated/project/list_projects_debug_build.feature @@ -1,5 +1,5 @@ @api -Feature: List programs with and without debug build type +Feature: List projects with and without debug build type Background: Given there are users: @@ -12,19 +12,19 @@ Feature: List programs with and without debug build type | 3 | phiro | And there are projects: | id | name | description | downloads | views | upload time | version | debug | extensions | owned by | - | 1 | program 1 | p1 | 3 | 12 | 01.01.2013 12:00 | 0.9.10 | false | mindstorms,drone | GeneratedUser1 | - | 2 | program 2 | | 333 | 9 | 22.04.2014 13:00 | 0.9.10 | false | | GeneratedUser1 | - | 3 | debug program | new one | 450 | 80 | 01.04.2019 09:00 | 1.0.12 | true | mindstorms,phiro | GeneratedUser1 | - | 4 | program 4 | | 133 | 33 | 01.01.2012 13:00 | 0.9.10 | false | mindstorms | GeneratedUser1 | + | 1 | project 1 | p1 | 3 | 12 | 01.01.2013 12:00 | 0.9.10 | false | mindstorms,drone | GeneratedUser1 | + | 2 | project 2 | | 333 | 9 | 22.04.2014 13:00 | 0.9.10 | false | | GeneratedUser1 | + | 3 | debug project | new one | 450 | 80 | 01.04.2019 09:00 | 1.0.12 | true | mindstorms,phiro | GeneratedUser1 | + | 4 | project 4 | | 133 | 33 | 01.01.2012 13:00 | 0.9.10 | false | mindstorms | GeneratedUser1 | And the current time is "01.08.2019 00:00" - And I store the following json object as "debug_program": + And I store the following json object as "debug_project": """ { "CatrobatProjects": [ { "ProjectId": "REGEX_STRING_WILDCARD", - "ProjectName": "debug program", - "ProjectNameShort": "debug program", + "ProjectName": "debug project", + "ProjectNameShort": "debug project", "Author": "GeneratedUser1", "Description": "new one", "Version": "1.0.12", @@ -49,13 +49,13 @@ Feature: List programs with and without debug build type } } """ - And I store the following json object as "debug_program_id": + And I store the following json object as "debug_project_id": """ { "CatrobatProjects": [ { "ProjectId": "REGEX_STRING_WILDCARD", - "ProjectName": "debug program" + "ProjectName": "debug project" } ], "completeTerm": "", @@ -67,14 +67,14 @@ Feature: List programs with and without debug build type } } """ - And I store the following json object as "program_2": + And I store the following json object as "project_2": """ { "CatrobatProjects": [ { "ProjectId": "REGEX_STRING_WILDCARD", - "ProjectName": "program 2", - "ProjectNameShort": "program 2", + "ProjectName": "project 2", + "ProjectNameShort": "project 2", "Author": "GeneratedUser1", "Description": "", "Version": "0.9.10", @@ -99,13 +99,13 @@ Feature: List programs with and without debug build type } } """ - And I store the following json object as "program_2_id": + And I store the following json object as "project_2_id": """ { "CatrobatProjects": [ { "ProjectId": "REGEX_STRING_WILDCARD", - "ProjectName": "program 2" + "ProjectName": "project 2" } ], "completeTerm": "", @@ -117,14 +117,14 @@ Feature: List programs with and without debug build type } } """ - And I store the following json object as "program_4": + And I store the following json object as "project_4": """ { "CatrobatProjects": [ { "ProjectId": "REGEX_STRING_WILDCARD", - "ProjectName": "program 4", - "ProjectNameShort": "program 4", + "ProjectName": "project 4", + "ProjectNameShort": "project 4", "Author": "GeneratedUser1", "Description": "", "Version": "0.9.10", @@ -149,13 +149,13 @@ Feature: List programs with and without debug build type } } """ - And I store the following json object as "program_4_id": + And I store the following json object as "project_4_id": """ { "CatrobatProjects": [ { "ProjectId": "REGEX_STRING_WILDCARD", - "ProjectName": "program 4" + "ProjectName": "project 4" } ], "completeTerm": "", @@ -168,7 +168,7 @@ Feature: List programs with and without debug build type } """ - Scenario Outline: Show most downloaded/viewed/recent program with debug and release app + Scenario Outline: Show most downloaded/viewed/recent project with debug and release app Given I request from a build of the Catroid app And I have a parameter "limit" with value "1" And I have a parameter "offset" with value "0" @@ -177,46 +177,46 @@ Feature: List programs with and without debug build type Examples: | end point | build type | json name | - | mostDownloaded | debug | debug_program | - | mostDownloaded | release | program_2 | - | mostViewed | debug | debug_program | - | mostViewed | release | program_4 | - | recent | debug | debug_program | - | recent | release | program_2 | + | mostDownloaded | debug | debug_project | + | mostDownloaded | release | project_2 | + | mostViewed | debug | debug_project | + | mostViewed | release | project_4 | + | recent | debug | debug_project | + | recent | release | project_2 | Scenario Outline: Show user projects with debug and release app Given I request from a build of the Catroid app And I have a parameter "user_id" with value "1" When I GET "/app/api/projects/userProjects.json" with these parameters Then I should get a total of projects - And I should get the projects "" + And I should get the projects "" Examples: - | build type | total | programs | - | debug | 4 | debug program,program 2,program 1,program 4 | - | release | 3 | program 2,program 1,program 4 | + | build type | total | projects | + | debug | 4 | debug project,project 2,project 1,project 4 | + | release | 3 | project 2,project 1,project 4 | - Scenario Outline: Search for debug program in debug and release app + Scenario Outline: Search for debug project in debug and release app Given I request from a build of the Catroid app When searching for "debug" Then I should get a total of projects - And I should get the projects "" + And I should get the projects "" Examples: - | build type | total | programs | - | debug | 1 | debug program | + | build type | total | projects | + | debug | 1 | debug project | | release | 0 | | - Scenario Outline: Search for programs with specific extension in debug and release app + Scenario Outline: Search for projects with specific extension in debug and release app Given I request from a build of the Catroid app And I have a parameter "q" with value "" And I have a parameter "limit" with value "5" And I have a parameter "offset" with value "0" When I GET "/app/api/projects/search/.json" with these parameters Then I should get a total of projects - And I should get the projects "" + And I should get the projects "" Examples: - | end point | build type | q | programs | total | - | extensionProjects | debug | mindstorms | debug program,program 1,program 4 | 3 | - | extensionProjects | release | mindstorms | program 1,program 4 | 2 | + | end point | build type | q | projects | total | + | extensionProjects | debug | mindstorms | debug project,project 1,project 4 | 3 | + | extensionProjects | release | mindstorms | project 1,project 4 | 2 | diff --git a/tests/BehatFeatures/api-deprecated/project/program_details.feature b/tests/BehatFeatures/api-deprecated/project/project_details.feature similarity index 82% rename from tests/BehatFeatures/api-deprecated/project/program_details.feature rename to tests/BehatFeatures/api-deprecated/project/project_details.feature index 662f35b9ca..44b2eb8d8a 100644 --- a/tests/BehatFeatures/api-deprecated/project/program_details.feature +++ b/tests/BehatFeatures/api-deprecated/project/project_details.feature @@ -1,5 +1,5 @@ @api -Feature: Get details for a specific program +Feature: Get details for a specific project Background: Given there are users: @@ -8,12 +8,12 @@ Feature: Get details for a specific program | User1 | vwxyz | aaaaaaaaaa | 2 | And there are projects: | id | name | description | owned by | downloads | views | upload time | version | file_size | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | 1024 | - | 2 | program 2 | | Catrobat | 333 | 9 | 22.04.2014 13:00 | 0.8.5 | 2621440 | - | 3 | program 3 | | User1 | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | 1337 | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | 1024 | + | 2 | project 2 | | Catrobat | 333 | 9 | 22.04.2014 13:00 | 0.8.5 | 2621440 | + | 3 | project 3 | | User1 | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | 1337 | And the current time is "01.08.2014 13:00" - Scenario: show details of a program with given id + Scenario: show details of a project with given id Given I have a parameter "id" with value "2" When I GET "/app/api/projects/getInfoById.json" with these parameters Then I should get the json object: @@ -21,8 +21,8 @@ Feature: Get details for a specific program { "CatrobatProjects":[{ "ProjectId": "REGEX_STRING_WILDCARD", - "ProjectName":"program 2", - "ProjectNameShort":"program 2", + "ProjectName":"project 2", + "ProjectNameShort":"project 2", "Author":"Catrobat", "Description":"", "Version":"0.8.5", @@ -48,7 +48,7 @@ Feature: Get details for a specific program } """ - Scenario: return error if no program matches the given id + Scenario: return error if no project matches the given id Given I have a parameter "id" with value "9" When I GET "/app/api/projects/getInfoById.json" with these parameters Then I should get the json object: diff --git a/tests/BehatFeatures/api-deprecated/project/report_program.feature b/tests/BehatFeatures/api-deprecated/project/report_project.feature similarity index 78% rename from tests/BehatFeatures/api-deprecated/project/report_program.feature rename to tests/BehatFeatures/api-deprecated/project/report_project.feature index 84b8fc8e6b..bcbc40132f 100644 --- a/tests/BehatFeatures/api-deprecated/project/report_program.feature +++ b/tests/BehatFeatures/api-deprecated/project/report_project.feature @@ -1,5 +1,5 @@ @api -Feature: Report a program +Feature: Report a project Background: Given there are users: @@ -8,19 +8,19 @@ Feature: Report a program | User1 | vwxyz | aaaaaaaaaa | 2 | Abc123 | And there are projects: | id | name | description | owned by | downloads | views | upload time | version | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | - | 2 | program 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | - | 3 | program 3 | | User1 | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | + | 2 | project 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | + | 3 | project 3 | | User1 | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | Scenario: Report project over old API not possible without being logged in - Given I have a parameter "program" with value "1" + Given I have a parameter "project" with value "1" And I have a parameter "category" with value "spam" And I have a parameter "note" with value "Bad Project" When I POST these parameters to "/app/api/reportProject/reportProject.json" Then the response status code should be "401" - Scenario: report program with invalid project - Given I have a parameter "program" with value "4" + Scenario: report project with invalid project + Given I have a parameter "project" with value "4" And I have a parameter "category" with value "Bad Project" And I have a parameter "note" with value "Bad Project" When I POST these parameters to "/app/api/reportProject/reportProject.json" @@ -29,8 +29,8 @@ Feature: Report a program {"statusCode":506,"answer":"Invalid project.","preHeaderMessages":""} """ - Scenario: report program with missing parameter - Given I have a parameter "program" with value "" + Scenario: report project with missing parameter + Given I have a parameter "project" with value "" And I have a parameter "category" with value "" And I have a parameter "note" with value "Bad project" When I POST these parameters to "/app/api/reportProject/reportProject.json" @@ -40,7 +40,7 @@ Feature: Report a program """ Scenario: Report project over old API requires upload_token - Given I have a parameter "program" with value "1" + Given I have a parameter "project" with value "1" And I have a parameter "category" with value "spam" And I have a parameter "note" with value "Bad Project" And I use a valid upload token for "Catrobat" @@ -48,7 +48,7 @@ Feature: Report a program Then the response status code should be "200" Scenario: Report project already supports new tokens - Given I have a parameter "program" with value "1" + Given I have a parameter "project" with value "1" And I have a parameter "category" with value "spam" And I have a parameter "note" with value "Bad Project" And I use a valid JWT Bearer token for "Catrobat" diff --git a/tests/BehatFeatures/api-deprecated/upload/upload.feature b/tests/BehatFeatures/api-deprecated/upload/upload.feature index eb0daff178..39e535c3b4 100644 --- a/tests/BehatFeatures/api-deprecated/upload/upload.feature +++ b/tests/BehatFeatures/api-deprecated/upload/upload.feature @@ -1,5 +1,5 @@ @api @upload -Feature: Upload a program to the website +Feature: Upload a project to the website Background: @@ -8,7 +8,7 @@ Feature: Upload a program to the website | Catrobat | 12345 | cccccccccc | 1 | | User1 | vwxyz | aaaaaaaaaa | 2 | - Scenario: Upload program + Scenario: Upload project Given the HTTP Request: | Method | POST | | Url | /app/api/upload/upload.json | @@ -46,4 +46,4 @@ Feature: Upload a program to the website Examples: | problem | errorcode | answer | | missing parameters | 501 | POST-data not correct or missing! | - | invalid program file | 505 | invalid file | + | invalid project file | 505 | invalid file | diff --git a/tests/BehatFeatures/api-deprecated/upload/upload_embroidery_project.feature b/tests/BehatFeatures/api-deprecated/upload/upload_embroidery_project.feature index a4fd47c27d..02a5f60d17 100644 --- a/tests/BehatFeatures/api-deprecated/upload/upload_embroidery_project.feature +++ b/tests/BehatFeatures/api-deprecated/upload/upload_embroidery_project.feature @@ -1,5 +1,5 @@ @api @upload @tag -Feature: Upload a program with tag +Feature: Upload a project with tag Background: Given there are extensions: @@ -10,7 +10,7 @@ Feature: Upload a program with tag | 4 | phiro | | 5 | embroidery | - Scenario: uploading a embroidery project should add the extension to the program + Scenario: uploading a embroidery project should add the extension to the project Given I have an embroidery project And I use the "english" app, API version 1 When I upload this generated project, API version 1 diff --git a/tests/BehatFeatures/api-deprecated/upload/upload_program.feature b/tests/BehatFeatures/api-deprecated/upload/upload_project.feature similarity index 82% rename from tests/BehatFeatures/api-deprecated/upload/upload_program.feature rename to tests/BehatFeatures/api-deprecated/upload/upload_project.feature index 22bdadbfed..8940d29862 100644 --- a/tests/BehatFeatures/api-deprecated/upload/upload_program.feature +++ b/tests/BehatFeatures/api-deprecated/upload/upload_project.feature @@ -1,5 +1,5 @@ @api @upload -Feature: Upload a program +Feature: Upload a project Background: Given there are users: @@ -8,11 +8,11 @@ Feature: Upload a program | User1 | vwxyz | aaaaaaaaaa | 2 | And there are projects: | id | name | description | owned by | downloads | views | upload time | version | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | - | 2 | program 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | - | 3 | program 3 | | User1 | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | + | 2 | project 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | + | 3 | project 3 | | User1 | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | - Scenario: program upload with valid data + Scenario: Project upload with valid data Given I have a parameter "username" with value "Catrobat" And I have a parameter "token" with value "cccccccccc" And I have a valid Catrobat file, API version 1 @@ -23,7 +23,7 @@ Feature: Upload a program {"projectId":"REGEX_STRING_WILDCARD","statusCode":200,"answer":"Your project was uploaded successfully!","token":"REGEX_STRING_WILDCARD","preHeaderMessages":""} """ - Scenario: missing all prameters will result in an error + Scenario: Missing all prameters will result in an error Given I have a parameter "username" with value "Catrobat" And I have a parameter "token" with value "cccccccccc" When I POST these parameters to "/app/api/upload/upload.json" @@ -32,31 +32,31 @@ Feature: Upload a program {"statusCode":501,"answer":"POST-data not correct or missing!","preHeaderMessages":""} """ - Scenario: trying to upload with an invalid user is okay, only token is used + Scenario: Trying to upload with an invalid user is okay, only token is used Given I have a parameter "username" with value "INVALID" And I have a parameter "token" with value "cccccccccc" When I POST these parameters to "/app/api/upload/upload.json" Then the response code should be "200" - Scenario: trying to upload with an invalid token should result in an error + Scenario: Trying to upload with an invalid token should result in an error Given I have a parameter "username" with value "Catrobat" And I have a parameter "token" with value "INVALID" When I POST these parameters to "/app/api/upload/upload.json" Then the response code should be "403" - Scenario: trying to upload with a missing token should result in an error + Scenario: Trying to upload with a missing token should result in an error Given I have a parameter "username" with value "Catrobat" When I POST these parameters to "/app/api/upload/upload.json" Then the response code should be "401" - Scenario: uploading the same project again should result in an update + Scenario: Uploading the same project again should result in an update Given I am "Catrobat" When I upload a valid Catrobat project, API version 1 And I upload a valid Catrobat project with the same name, API version 1 Then the uploaded project should exist in the database, API version 1 And it should be updated, API version 1 - Scenario: program with missing file checksum are rejected + Scenario: Project with missing file checksum are rejected Given I have a parameter "username" with value "Catrobat" And I have a parameter "token" with value "cccccccccc" And I have a valid Catrobat file, API version 1 @@ -66,7 +66,7 @@ Feature: Upload a program {"statusCode":503,"answer":"Client did not send fileChecksum! Are you using an outdated version of Pocket Code?","preHeaderMessages":""} """ - Scenario: program with invalid file checksum are rejected + Scenario: Project with invalid file checksum are rejected Given I have a parameter "username" with value "Catrobat" And I have a parameter "token" with value "cccccccccc" And I have a valid Catrobat file, API version 1 @@ -84,12 +84,12 @@ Feature: Upload a program When I upload another project using token "cccccccccc" Then the uploaded project should exist in the database, API version 1 - Scenario: Program Sanitizer should remove unnecessary files + Scenario: Project Sanitizer should remove unnecessary files Given I try to upload a project with unnecessary files, API version 1 Then the uploaded project should exist in the database, API version 1 And the resources should not contain the unnecessary files - Scenario: Program Sanitizer should remove unnecessary files even when scenes are used + Scenario: Project Sanitizer should remove unnecessary files even when scenes are used Given I try to upload a project with scenes and unnecessary files, API version 1 Then the uploaded project should exist in the database, API version 1 And the resources should not contain the unnecessary files diff --git a/tests/BehatFeatures/api-deprecated/upload/upload_program_with_Extension.feature b/tests/BehatFeatures/api-deprecated/upload/upload_project_with_Extension.feature similarity index 84% rename from tests/BehatFeatures/api-deprecated/upload/upload_program_with_Extension.feature rename to tests/BehatFeatures/api-deprecated/upload/upload_project_with_Extension.feature index b75620d716..0b9bb4b9ea 100644 --- a/tests/BehatFeatures/api-deprecated/upload/upload_program_with_Extension.feature +++ b/tests/BehatFeatures/api-deprecated/upload/upload_project_with_Extension.feature @@ -1,5 +1,5 @@ @api @upload @extensions -Feature: Upload a program with extensions +Feature: Upload a project with extensions Background: Given there are users: @@ -7,7 +7,7 @@ Feature: Upload a program with extensions | Catrobat | 12345 | cccccccccc | 1 | And there are projects: | id | name | description | owned by | downloads | views | upload time | version | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | And there are extensions: | id | internal_title | | 1 | arduino | @@ -16,12 +16,12 @@ Feature: Upload a program with extensions | 4 | phiro | | 5 | raspberry_pi | - Scenario: upload a program with extensions + Scenario: upload a project with extensions Given I have a project with arduino, mindstorms and phiro extensions And I upload this generated project with id "2", API version 1 Then the project with id "2" should be marked with "3" extensions in the database - Scenario: update a program with extensions + Scenario: update a project with extensions Given I have a project with arduino, mindstorms and phiro extensions And I upload this generated project with id "2", API version 1 When I upload this generated project again without extensions, API version 1 diff --git a/tests/BehatFeatures/api-deprecated/upload/upload_program_with_Tag.feature b/tests/BehatFeatures/api-deprecated/upload/upload_project_with_Tag.feature similarity index 87% rename from tests/BehatFeatures/api-deprecated/upload/upload_program_with_Tag.feature rename to tests/BehatFeatures/api-deprecated/upload/upload_project_with_Tag.feature index 3a36f72960..f3991022f8 100644 --- a/tests/BehatFeatures/api-deprecated/upload/upload_program_with_Tag.feature +++ b/tests/BehatFeatures/api-deprecated/upload/upload_project_with_Tag.feature @@ -1,5 +1,5 @@ @api @upload @tag -Feature: Upload a program with tag +Feature: Upload a project with tag Background: Given there are users: @@ -29,31 +29,31 @@ Feature: Upload a program with tag } """ - Scenario: upload a tagged program with tags Games and Story + Scenario: upload a tagged project with tags Games and Story Given I have a project with "tags" set to "Games,Story" And I use the "english" app, API version 1 When I upload this generated project, API version 1 Then the project should be tagged with "Games,Story" in the database - Scenario: upload a tagged program with tags Music and Art on a device with no supported language + Scenario: upload a tagged project with tags Music and Art on a device with no supported language Given I have a project with "tags" set to "Music,Art" And I use the "unknownLanguage" app, API version 1 When I upload this generated project, API version 1 Then the project should be tagged with "Music,Art" in the database - Scenario: upload a tagged program with unknown tags + Scenario: upload a tagged project with unknown tags Given I have a project with "tags" set to "Huhu,dontKnow" And I use the "english" app, API version 1 When I upload this generated project, API version 1 Then the project should not be tagged - Scenario: upload a tagged program with more then three tags + Scenario: upload a tagged project with more then three tags Given I have a project with "tags" set to "Games,Story,Music,Art" And I use the "english" app, API version 1 When I upload this generated project, API version 1 Then the project should be tagged with "Games,Story,Music" in the database - Scenario: update a program with other tags + Scenario: update a project with other tags Given I have a project with "tags" set to "Music,Art" And I use the "english" app, API version 1 And I upload this generated project, API version 1 diff --git a/tests/BehatFeatures/api-deprecated/upload/upload_remix_uuid.feature b/tests/BehatFeatures/api-deprecated/upload/upload_remix_uuid.feature index b069cfab75..f7cc038728 100644 --- a/tests/BehatFeatures/api-deprecated/upload/upload_remix_uuid.feature +++ b/tests/BehatFeatures/api-deprecated/upload/upload_remix_uuid.feature @@ -1,5 +1,5 @@ @api @upload @remixes @reupload -Feature: Upload a remixed program with multiple parents should also work with the new UUIDs +Feature: Upload a remixed project with multiple parents should also work with the new UUIDs Background: Given there are users: @@ -8,13 +8,13 @@ Feature: Upload a remixed program with multiple parents should also work with th And there are projects: | id | name | description | owned by | downloads | views | upload time | version | remix_root | - | 390a46b7-4dca-11ea-b467-08002765cf2c | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | - | 38389632-4dca-11ea-b467-08002765cf2c | program 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | true | - | 35d70287-4dca-11ea-b467-08002765cf2c | program 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | true | - | 379dc210-4dca-11ea-b467-08002765cf2c | program 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | false | - | 110a46b7-4dca-11ea-b467-08002765cf2c | program 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | - | 220a46b7-4dca-11ea-b467-08002765cf2c | program 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 330a46b7-4dca-11ea-b467-08002765cf2c | program 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 390a46b7-4dca-11ea-b467-08002765cf2c | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | + | 38389632-4dca-11ea-b467-08002765cf2c | project 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | true | + | 35d70287-4dca-11ea-b467-08002765cf2c | project 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | true | + | 379dc210-4dca-11ea-b467-08002765cf2c | project 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | false | + | 110a46b7-4dca-11ea-b467-08002765cf2c | project 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | + | 220a46b7-4dca-11ea-b467-08002765cf2c | project 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 330a46b7-4dca-11ea-b467-08002765cf2c | project 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | #------------------------------------------------------------------------------------------------------------------- # this is how the remix graph looks like according to the following forward remix relations (closure table): @@ -58,9 +58,9 @@ Feature: Upload a remixed program with multiple parents should also work with th | 29495624 | 110a46b7-4dca-11ea-b467-08002765cf2c | | 29495624 | 330a46b7-4dca-11ea-b467-08002765cf2c | - Scenario: reuploading program 4 with only one parent unlinks former parent + Scenario: reuploading project 4 with only one parent unlinks former parent #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (2) (3) (Scratch) (1) (2) (3) (Scratch) # \ / / / \ / / @@ -72,7 +72,7 @@ Feature: Upload a remixed program with multiple parents should also work with th # #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 4" and "url" set to "program 390a46b7-4dca-11ea-b467-08002765cf2c[/pocketalice/project/390a46b7-4dca-11ea-b467-08002765cf2c]" + Given I have a project with "name" set to "project 4" and "url" set to "project 390a46b7-4dca-11ea-b467-08002765cf2c[/pocketalice/project/390a46b7-4dca-11ea-b467-08002765cf2c]" When I upload a generated project, API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -84,7 +84,7 @@ Feature: Upload a remixed program with multiple parents should also work with th And the uploaded project should have a Catrobat forward descendant having id "220a46b7-4dca-11ea-b467-08002765cf2c" and depth "1", API version 1 And the uploaded project should have a Catrobat forward descendant having id "330a46b7-4dca-11ea-b467-08002765cf2c" and depth "2", API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "program 390a46b7-4dca-11ea-b467-08002765cf2c[/pocketalice/project/390a46b7-4dca-11ea-b467-08002765cf2c]" in the xml, API version 1 + And the uploaded project should have RemixOf "project 390a46b7-4dca-11ea-b467-08002765cf2c[/pocketalice/project/390a46b7-4dca-11ea-b467-08002765cf2c]" in the xml, API version 1 And the project "390a46b7-4dca-11ea-b467-08002765cf2c" should be a remix root And the project "390a46b7-4dca-11ea-b467-08002765cf2c" should have a Catrobat forward ancestor having id "390a46b7-4dca-11ea-b467-08002765cf2c" and depth "0" diff --git a/tests/BehatFeatures/api-deprecated/upload/upload_remixed_program_again.feature b/tests/BehatFeatures/api-deprecated/upload/upload_remixed_project_again.feature similarity index 94% rename from tests/BehatFeatures/api-deprecated/upload/upload_remixed_program_again.feature rename to tests/BehatFeatures/api-deprecated/upload/upload_remixed_project_again.feature index c076efa9e7..e664e6607f 100644 --- a/tests/BehatFeatures/api-deprecated/upload/upload_remixed_program_again.feature +++ b/tests/BehatFeatures/api-deprecated/upload/upload_remixed_project_again.feature @@ -1,5 +1,5 @@ @api @upload @remixes @reupload -Feature: Upload a remixed program with multiple parents +Feature: Upload a remixed project with multiple parents Background: Given there are users: @@ -8,13 +8,13 @@ Feature: Upload a remixed program with multiple parents And there are projects: | id | name | description | owned by | downloads | views | upload time | version | remix_root | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | - | 2 | program 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | true | - | 3 | program 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | true | - | 4 | program 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | false | - | 5 | program 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | - | 6 | program 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 7 | program 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | + | 2 | project 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | true | + | 3 | project 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | true | + | 4 | project 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | false | + | 5 | project 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | + | 6 | project 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 7 | project 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | #------------------------------------------------------------------------------------------------------------------- # this is how the remix graph looks like according to the following forward remix relations (closure table): @@ -58,9 +58,9 @@ Feature: Upload a remixed program with multiple parents | 29495624 | 5 | | 29495624 | 7 | - Scenario: reuploading program 4 with only one parent unlinks former parent + Scenario: reuploading project 4 with only one parent unlinks former parent #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (2) (3) (Scratch) (1) (2) (3) (Scratch) # \ / / / \ / / @@ -72,7 +72,7 @@ Feature: Upload a remixed program with multiple parents # #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 4" and "url" set to "program 1[/pocketalice/project/1]" + Given I have a project with "name" set to "project 4" and "url" set to "project 1[/pocketalice/project/1]" When I upload a generated project, API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -84,7 +84,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "1", API version 1 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "program 1[/pocketalice/project/1]" in the xml, API version 1 + And the uploaded project should have RemixOf "project 1[/pocketalice/project/1]" in the xml, API version 1 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -149,9 +149,9 @@ Feature: Upload a remixed program with multiple parents And the project "7" should have no further Scratch parents And the project "7" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 6 with only one parent unlinks former parent + Scenario: reuploading project 6 with only one parent unlinks former parent #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (2) (3) (Scratch) (1) (2) (3) (Scratch) # \ / / / \ / / / @@ -163,7 +163,7 @@ Feature: Upload a remixed program with multiple parents # #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6" and "url" set to "program 5[/pocketalice/project/5]" + Given I have a project with "name" set to "project 6" and "url" set to "project 5[/pocketalice/project/5]" When I upload a generated project, API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -175,7 +175,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Scratch parents, API version 1 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "1", API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "program 5[/pocketalice/project/5]" in the xml, API version 1 + And the uploaded project should have RemixOf "project 5[/pocketalice/project/5]" in the xml, API version 1 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -234,9 +234,9 @@ Feature: Upload a remixed program with multiple parents And the project "7" should have no further Scratch parents And the project "7" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 6 with additional backward parent creates backward relation and unlinks former parent + Scenario: reuploading project 6 with additional backward parent creates backward relation and unlinks former parent #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (2) (3) (Scratch) (1) (2) (3) (Scratch) # \ / / / \ / / / @@ -247,10 +247,10 @@ Feature: Upload a remixed program with multiple parents # (7)_______/ (7)_______/ # #------------------------------------------------------------------------------------------------------------------- - # Expected result after upload: program 7 becomes a backward parent of program 6 as well! + # Expected result after upload: project 7 becomes a backward parent of project 6 as well! #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6", "url" set to "program 6[/app/project/6], Merge 1[program 5[/pocketalice/project/5], program 7[/pocketalice/project/7]]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 6", "url" set to "project 6[/app/project/6], Merge 1[project 5[/pocketalice/project/5], project 7[/pocketalice/project/7]]" and "catrobatLanguageVersion" set to "0.993" When I upload a generated project, API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -263,7 +263,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Scratch parents, API version 1 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "1", API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "program 6[/app/project/6], Merge 1[program 5[/pocketalice/project/5], program 7[/pocketalice/project/7]]" in the xml, API version 1 + And the uploaded project should have RemixOf "project 6[/app/project/6], Merge 1[project 5[/pocketalice/project/5], project 7[/pocketalice/project/7]]" in the xml, API version 1 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -322,10 +322,10 @@ Feature: Upload a remixed program with multiple parents And the project "7" should have no further Scratch parents And the project "7" should have no Catrobat forward descendants except self-relation - Scenario: reuploading former root program 1 with two new Scratch parents and one additional backward parent + Scenario: reuploading former root project 1 with two new Scratch parents and one additional backward parent creates backward relation and two new Scratch relations #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (Scratch #2) (Scratch #1) # \ ___________________/ @@ -339,10 +339,10 @@ Feature: Upload a remixed program with multiple parents # (7)_______/ (7)_______/ # #------------------------------------------------------------------------------------------------------------------- - # Expected result after upload: program 6 becomes a backward parent of program 1 as well! + # Expected result after upload: project 6 becomes a backward parent of project 1 as well! #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 1", "url" set to "Test Scratch [https://scratch.mit.edu/projects/1], Merge1[program 6[/app/project/6], Music Inventor [https://scratch.mit.edu/projects/29495624]]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 1", "url" set to "Test Scratch [https://scratch.mit.edu/projects/1], Merge1[project 6[/app/project/6], Music Inventor [https://scratch.mit.edu/projects/29495624]]" and "catrobatLanguageVersion" set to "0.993" When I upload a generated project, API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -357,7 +357,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "2", API version 1 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "3", API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "Test Scratch [https://scratch.mit.edu/projects/1], Merge1[program 6[/app/project/6], Music Inventor [https://scratch.mit.edu/projects/29495624]]" in the xml, API version 1 + And the uploaded project should have RemixOf "Test Scratch [https://scratch.mit.edu/projects/1], Merge1[project 6[/app/project/6], Music Inventor [https://scratch.mit.edu/projects/29495624]]" in the xml, API version 1 And the project "2" should be a remix root And the project "2" should have a Catrobat forward ancestor having id "2" and depth "0" @@ -428,10 +428,10 @@ Feature: Upload a remixed program with multiple parents And the project "7" should have no further Scratch parents And the project "7" should have no Catrobat forward descendants except self-relation - Scenario: reuploading former root program 1 with one new Scratch parent and one additional backward parent + Scenario: reuploading former root project 1 with one new Scratch parent and one additional backward parent creates backward relation and new Scratch relation #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (Scratch) # ___________________/ @@ -445,10 +445,10 @@ Feature: Upload a remixed program with multiple parents # (7)_______/ (7)_______/ # #------------------------------------------------------------------------------------------------------------------- - # Expected result after upload: program 7 becomes a backward parent of program 1 as well! + # Expected result after upload: project 7 becomes a backward parent of project 1 as well! #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 1", "url" set to "program 7[/app/project/7], Music Inventor [https://scratch.mit.edu/projects/29495624]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 1", "url" set to "project 7[/app/project/7], Music Inventor [https://scratch.mit.edu/projects/29495624]" and "catrobatLanguageVersion" set to "0.993" When I upload a generated project, API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -462,7 +462,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "2", API version 1 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "3", API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "program 7[/app/project/7], Music Inventor [https://scratch.mit.edu/projects/29495624]" in the xml, API version 1 + And the uploaded project should have RemixOf "project 7[/app/project/7], Music Inventor [https://scratch.mit.edu/projects/29495624]" in the xml, API version 1 And the project "2" should be a remix root And the project "2" should have a Catrobat forward ancestor having id "2" and depth "0" @@ -533,10 +533,10 @@ Feature: Upload a remixed program with multiple parents And the project "7" should have no further Scratch parents And the project "7" should have no Catrobat forward descendants except self-relation - Scenario: reuploading former root program 1 with program 5 as forward parent appends program 1 accordingly and - inherits all ancestors of program 5 to program 1 + Scenario: reuploading former root project 1 with project 5 as forward parent appends project 1 accordingly and + inherits all ancestors of project 5 to project 1 #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (3) (Scratch) # \ / \ @@ -552,7 +552,7 @@ Feature: Upload a remixed program with multiple parents # #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 1" and "url" set to "program 5[/app/project/5]" + Given I have a project with "name" set to "project 1" and "url" set to "project 5[/app/project/5]" When I upload a generated project, API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -566,7 +566,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "2", API version 1 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "3", API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "program 5[/app/project/5]" in the xml, API version 1 + And the uploaded project should have RemixOf "project 5[/app/project/5]" in the xml, API version 1 And the project "2" should be a remix root And the project "2" should have a Catrobat forward ancestor having id "2" and depth "0" diff --git a/tests/BehatFeatures/api-deprecated/upload/upload_remixed_program_again_complex.feature b/tests/BehatFeatures/api-deprecated/upload/upload_remixed_project_again_complex.feature similarity index 96% rename from tests/BehatFeatures/api-deprecated/upload/upload_remixed_program_again_complex.feature rename to tests/BehatFeatures/api-deprecated/upload/upload_remixed_project_again_complex.feature index 8951b54598..5b9c6b2175 100644 --- a/tests/BehatFeatures/api-deprecated/upload/upload_remixed_program_again_complex.feature +++ b/tests/BehatFeatures/api-deprecated/upload/upload_remixed_project_again_complex.feature @@ -1,5 +1,5 @@ @api @upload @remixes @reupload -Feature: Upload a remixed program with multiple parents +Feature: Upload a remixed project with multiple parents Background: Given there are users: @@ -8,15 +8,15 @@ Feature: Upload a remixed program with multiple parents And there are projects: | id | name | description | owned by | downloads | views | upload time | version | remix_root | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | - | 2 | program 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | - | 3 | program 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 4 | program 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | false | - | 5 | program 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | - | 6 | program 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 7 | program 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 8 | program 8 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | true | - | 9 | program 9 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | + | 2 | project 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | + | 3 | project 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 4 | project 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | false | + | 5 | project 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | + | 6 | project 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 7 | project 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 8 | project 8 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | true | + | 9 | project 9 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | #------------------------------------------------------------------------------------------------------------------- # this is how the remix graph looks like according to the following forward remix relations (closure table): @@ -80,9 +80,9 @@ Feature: Upload a remixed program with multiple parents | 6 | 4 | | 6 | 2 | - Scenario: reuploading program 2 with no parent-URLs should unlink all former remix ancestors (except self referencing relation) + Scenario: reuploading project 2 with no parent-URLs should unlink all former remix ancestors (except self referencing relation) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / @@ -96,7 +96,7 @@ Feature: Upload a remixed program with multiple parents # #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 2" and "url" set to "" + Given I have a project with "name" set to "project 2" and "url" set to "" When I upload a generated project, API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -195,10 +195,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 2 with parent-URLs referring to no existing Catrobat programs should unlink all former + Scenario: reuploading project 2 with parent-URLs referring to no existing Catrobat projects should unlink all former remix ancestors (except self referencing relation) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / @@ -212,7 +212,7 @@ Feature: Upload a remixed program with multiple parents # #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 2", "url" set to "Program 10 [/app/project/10], Program 11 [https://share.catrob.at/app/project/11]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 2", "url" set to "Project 10 [/app/project/10], Project 11 [https://share.catrob.at/app/project/11]" and "catrobatLanguageVersion" set to "0.993" When I upload a generated project, API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -227,7 +227,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 1 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "3", API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "Program 10 [/app/project/10], Program 11 [https://share.catrob.at/app/project/11]" in the xml, API version 1 + And the uploaded project should have RemixOf "Project 10 [/app/project/10], Project 11 [https://share.catrob.at/app/project/11]" in the xml, API version 1 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -311,10 +311,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 2 with parent-URL referring only to Scratch program should unlink all former + Scenario: reuploading project 2 with parent-URL referring only to Scratch project should unlink all former Catrobat remix ancestors (except self referencing relation) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / @@ -328,7 +328,7 @@ Feature: Upload a remixed program with multiple parents # #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 2" and "url" set to "Music Inventor [https://scratch.mit.edu/projects/29495624]" + Given I have a project with "name" set to "project 2" and "url" set to "Music Inventor [https://scratch.mit.edu/projects/29495624]" When I upload a generated project, API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -428,10 +428,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 2 with parent-URLs referring only to Scratch program but no valid Catrobat programs should + Scenario: reuploading project 2 with parent-URLs referring only to Scratch project but no valid Catrobat projects should unlink all former Catrobat remix ancestors (except self referencing relation) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / @@ -445,7 +445,7 @@ Feature: Upload a remixed program with multiple parents # #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 2", "url" set to "Program 10 [/app/project/10], Music Inventor [https://scratch.mit.edu/projects/29495624]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 2", "url" set to "Project 10 [/app/project/10], Music Inventor [https://scratch.mit.edu/projects/29495624]" and "catrobatLanguageVersion" set to "0.993" When I upload a generated project, API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -461,7 +461,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 1 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "3", API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "Program 10 [/app/project/10], Music Inventor [https://scratch.mit.edu/projects/29495624]" in the xml, API version 1 + And the uploaded project should have RemixOf "Project 10 [/app/project/10], Music Inventor [https://scratch.mit.edu/projects/29495624]" in the xml, API version 1 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -545,9 +545,9 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 4 with same parent-URLs should change remix graph + Scenario: reuploading project 4 with same parent-URLs should change remix graph #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -564,7 +564,7 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 4", "url" set to "Program 2 [/app/project/2], Program 6 [/app/project/6]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 4", "url" set to "Project 2 [/app/project/2], Project 6 [/app/project/6]" and "catrobatLanguageVersion" set to "0.993" When I upload a generated project, API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -577,7 +577,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "1", API version 1 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "Program 2 [/app/project/2], Program 6 [/app/project/6]" in the xml, API version 1 + And the uploaded project should have RemixOf "Project 2 [/app/project/2], Project 6 [/app/project/6]" in the xml, API version 1 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -680,10 +680,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 4 with parent-URLs referring only to its Catrobat forward ancestor (program 2) should - unlink its Catrobat backward parent (program 6) + Scenario: reuploading project 4 with parent-URLs referring only to its Catrobat forward ancestor (project 2) should + unlink its Catrobat backward parent (project 6) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -700,7 +700,7 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 4" and "url" set to "Program 2 [/app/project/2]" + Given I have a project with "name" set to "project 4" and "url" set to "Project 2 [/app/project/2]" When I upload a generated project, API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -713,7 +713,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "1", API version 1 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "Program 2 [/app/project/2]" in the xml, API version 1 + And the uploaded project should have RemixOf "Project 2 [/app/project/2]" in the xml, API version 1 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -816,10 +816,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 4 with only backward parent (program 6) should only + Scenario: reuploading project 4 with only backward parent (project 6) should only unlink all former Catrobat forward ancestors #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -837,7 +837,7 @@ Feature: Upload a remixed program with multiple parents # Expected result after upload: 6 should remain being backward parent of 4 and 2. #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 4" and "url" set to "Program 6 [/app/project/6]" + Given I have a project with "name" set to "project 4" and "url" set to "Project 6 [/app/project/6]" When I upload a generated project, API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -849,7 +849,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "1", API version 1 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "Program 6 [/app/project/6]" in the xml, API version 1 + And the uploaded project should have RemixOf "Project 6 [/app/project/6]" in the xml, API version 1 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -950,9 +950,9 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 3 with child program (program 6) as new parent should create backward relation + Scenario: reuploading project 3 with child project (project 6) as new parent should create backward relation #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -968,7 +968,7 @@ Feature: Upload a remixed program with multiple parents # Expected result after upload: 6 should become backward parent of 3, as 6 is already a child before upload! #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 3" and "url" set to "Program 6 [/app/project/6]" + Given I have a project with "name" set to "project 3" and "url" set to "Project 6 [/app/project/6]" When I upload a generated project, API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -981,7 +981,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "1", API version 1 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "Program 6 [/app/project/6]" in the xml, API version 1 + And the uploaded project should have RemixOf "Project 6 [/app/project/6]" in the xml, API version 1 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -1078,10 +1078,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 3 with child program (program 6) as only parent should create backward relation and + Scenario: reuploading project 3 with child project (project 6) as only parent should create backward relation and remove all former forward ancestors #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -1097,7 +1097,7 @@ Feature: Upload a remixed program with multiple parents # Expected result after upload: 7 should become backward parent of 3, as 7 is already a descendant of 3 before upload! #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 3" and "url" set to "Program 7 [/app/project/7]" + Given I have a project with "name" set to "project 3" and "url" set to "Project 7 [/app/project/7]" When I upload a generated project, API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -1110,7 +1110,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "1", API version 1 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "Program 7 [/app/project/7]" in the xml, API version 1 + And the uploaded project should have RemixOf "Project 7 [/app/project/7]" in the xml, API version 1 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -1207,10 +1207,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 2 with other Scratch program and child programs (program 6 and 7) + Scenario: reuploading project 2 with other Scratch project and child projects (project 6 and 7) as additional parents should create backward relations and replace old Scratch parent with new Scratch parent #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) (SCRATCH #2) # \ / \ _______________/| @@ -1226,7 +1226,7 @@ Feature: Upload a remixed program with multiple parents # Expected result after upload: 6 and 7 should be a backward parent of 2. #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 2", "url" set to "Program 6[https://share.catrob.at/app/project/6],Program 7[/pocketalice/project/7/], Merge 1[Program 1 [/flavors/project/1], The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 2", "url" set to "Project 6[https://share.catrob.at/app/project/6],Project 7[/pocketalice/project/7/], Merge 1[Project 1 [/flavors/project/1], The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]]" and "catrobatLanguageVersion" set to "0.993" When I upload a generated project, API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -1246,7 +1246,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 1 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "3", API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "Program 6[https://share.catrob.at/app/project/6],Program 7[/pocketalice/project/7/], Merge 1[Program 1 [/flavors/project/1], The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]]" in the xml, API version 1 + And the uploaded project should have RemixOf "Project 6[https://share.catrob.at/app/project/6],Project 7[/pocketalice/project/7/], Merge 1[Project 1 [/flavors/project/1], The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]]" in the xml, API version 1 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -1344,9 +1344,9 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading root program 2 becomes backward child of all of its child programs + Scenario: reuploading root project 2 becomes backward child of all of its child projects #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -1359,10 +1359,10 @@ Feature: Upload a remixed program with multiple parents # (7) (7) # #------------------------------------------------------------------------------------------------------------------- - # Expected result after upload: all Catrobat childs (2, 3, 4, 5, 6 and 7) become backward parent of program 1 + # Expected result after upload: all Catrobat childs (2, 3, 4, 5, 6 and 7) become backward parent of project 1 #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 1", "url" set to "program 1[/pocketalice/project/1],Merge 4 [program 7[/pocketalice/project/7], Merge3 [Program 6[/app/project/6], Merge 2[Program 5[https://share.catrob.at/app/project/5],Program 4[/pocketalice/project/4], Merge 1[Program 2 [/flavors/project/2], Program 3 [/flavors/project/3]]]]]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 1", "url" set to "project 1[/pocketalice/project/1],Merge 4 [project 7[/pocketalice/project/7], Merge3 [Project 6[/app/project/6], Merge 2[Project 5[https://share.catrob.at/app/project/5],Project 4[/pocketalice/project/4], Merge 1[Project 2 [/flavors/project/2], Project 3 [/flavors/project/3]]]]]" and "catrobatLanguageVersion" set to "0.993" When I upload a generated project, API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -1385,7 +1385,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "7" and depth "3", API version 1 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "4", API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "program 1[/pocketalice/project/1],Merge 4 [program 7[/pocketalice/project/7], Merge3 [Program 6[/app/project/6], Merge 2[Program 5[https://share.catrob.at/app/project/5],Program 4[/pocketalice/project/4], Merge 1[Program 2 [/flavors/project/2], Program 3 [/flavors/project/3]]]]]" in the xml, API version 1 + And the uploaded project should have RemixOf "project 1[/pocketalice/project/1],Merge 4 [project 7[/pocketalice/project/7], Merge3 [Project 6[/app/project/6], Merge 2[Project 5[https://share.catrob.at/app/project/5],Project 4[/pocketalice/project/4], Merge 1[Project 2 [/flavors/project/2], Project 3 [/flavors/project/3]]]]]" in the xml, API version 1 And the project "2" should not be a remix root And the project "2" should have a Catrobat forward ancestor having id "2" and depth "0" @@ -1485,9 +1485,9 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 2 with new parent (program 9) should inherit all its forward relations + Scenario: reuploading project 2 with new parent (project 9) should inherit all its forward relations #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # (8) # | # (9) @@ -1503,10 +1503,10 @@ Feature: Upload a remixed program with multiple parents # (7) (7) # #------------------------------------------------------------------------------------------------------------------- - # Expected result after upload: all Catrobat childs (2, 3, 4, 5, 6 and 7) become backward parent of program 1 + # Expected result after upload: all Catrobat childs (2, 3, 4, 5, 6 and 7) become backward parent of project 1 #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 1" and "url" set to "program 9[/pocketalice/project/9]" + Given I have a project with "name" set to "project 1" and "url" set to "project 9[/pocketalice/project/9]" When I upload a generated project, API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -1525,7 +1525,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "7" and depth "3", API version 1 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "4", API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "program 9[/pocketalice/project/9]" in the xml, API version 1 + And the uploaded project should have RemixOf "project 9[/pocketalice/project/9]" in the xml, API version 1 And the project "2" should not be a remix root And the project "2" should have a Catrobat forward ancestor having id "2" and depth "0" @@ -1659,10 +1659,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have a Catrobat forward descendant having id "7" and depth "5" And the project "9" should have no further Catrobat forward descendants - Scenario: reuploading program 6 with one less parent (program 3) should unlink only forward relation to program 3 + Scenario: reuploading project 6 with one less parent (project 3) should unlink only forward relation to project 3 but not deeper forward relations since these forward relations (1-6 and 2-6) are still needed #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -1679,7 +1679,7 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6", "url" set to "Merge 1[Program 4 [/app/project/4], Program 2 [/app/project/2]],The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 6", "url" set to "Merge 1[Project 4 [/app/project/4], Project 2 [/app/project/2]],The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]" and "catrobatLanguageVersion" set to "0.993" When I upload a generated project, API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -1695,7 +1695,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Scratch parent having id "70058680", API version 1 And the uploaded project should have no further Scratch parents, API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "Merge 1[Program 4 [/app/project/4], Program 2 [/app/project/2]],The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]" in the xml, API version 1 + And the uploaded project should have RemixOf "Merge 1[Project 4 [/app/project/4], Project 2 [/app/project/2]],The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]" in the xml, API version 1 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -1793,10 +1793,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 6 with one less parent (program 3) should unlink all program 3's forward relations + Scenario: reuploading project 6 with one less parent (project 3) should unlink all project 3's forward relations since they have different depth level than the ones still needed #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -1813,7 +1813,7 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6", "url" set to "Program 4 [/app/project/4],The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 6", "url" set to "Project 4 [/app/project/4],The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]" and "catrobatLanguageVersion" set to "0.993" When I upload a generated project, API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -1827,7 +1827,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Scratch parent having id "70058680", API version 1 And the uploaded project should have no further Scratch parents, API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "Program 4 [/app/project/4],The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]" in the xml, API version 1 + And the uploaded project should have RemixOf "Project 4 [/app/project/4],The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]" in the xml, API version 1 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -1919,11 +1919,11 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 6 with removed Scratch parent and with one less Catrobat parent (program 3) should - unlink Scratch parent relation and also unlink all program 3's forward relations since they have different + Scenario: reuploading project 6 with removed Scratch parent and with one less Catrobat parent (project 3) should + unlink Scratch parent relation and also unlink all project 3's forward relations since they have different depth level than the ones still needed #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -1940,7 +1940,7 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6" and "url" set to "Program 4 [/app/project/4]" + Given I have a project with "name" set to "project 6" and "url" set to "Project 4 [/app/project/4]" When I upload a generated project, API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -1953,7 +1953,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat backward parents, API version 1 And the uploaded project should have no Scratch parents, API version 1 And the uploaded project should have no further Catrobat forward descendants, API version 1 - And the uploaded project should have RemixOf "Program 4 [/app/project/4]" in the xml, API version 1 + And the uploaded project should have RemixOf "Project 4 [/app/project/4]" in the xml, API version 1 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -2045,10 +2045,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 6 with no parents any more should convert former backward relation (6 -> 4) + Scenario: reuploading project 6 with no parents any more should convert former backward relation (6 -> 4) to a forward ancestor relation #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) (6) (SCRATCH #2) # \ / \ / ______________/ @@ -2065,7 +2065,7 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6" and "url" set to "" + Given I have a project with "name" set to "project 6" and "url" set to "" When I upload a generated project, API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -2175,7 +2175,7 @@ Feature: Upload a remixed program with multiple parents Scenario: multiple consecutive reuploads (example #1) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) (6) (SCRATCH #2) # \ / \ / ______________/ @@ -2192,9 +2192,9 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6" and "url" set to "" + Given I have a project with "name" set to "project 6" and "url" set to "" When I upload a generated project, API version 1 - And I upload another project with name set to "program 4" and url set to "Program 2[/app/project/2]", API version 1 + And I upload another project with name set to "project 4" and url set to "Project 2[/app/project/2]", API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 And the uploaded project should have a Catrobat forward ancestor having id "4" and depth "0", API version 1 @@ -2205,7 +2205,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat backward parents, API version 1 And the uploaded project should have no Scratch parents, API version 1 And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 - And the uploaded project should have RemixOf "Program 2[/app/project/2]" in the xml, API version 1 + And the uploaded project should have RemixOf "Project 2[/app/project/2]" in the xml, API version 1 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -2302,7 +2302,7 @@ Feature: Upload a remixed program with multiple parents Scenario: multiple consecutive reuploads (example #2) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) (6) (SCRATCH #2) # \ / \ / ______________/ @@ -2319,9 +2319,9 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6" and "url" set to "" + Given I have a project with "name" set to "project 6" and "url" set to "" When I upload a generated project, API version 1 - And I upload another project with name set to "program 4" and url set to "", API version 1 + And I upload another project with name set to "project 4" and url set to "", API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 And the uploaded project should have a Catrobat forward ancestor having id "4" and depth "0", API version 1 @@ -2423,7 +2423,7 @@ Feature: Upload a remixed program with multiple parents Scenario: multiple consecutive reuploads (example #3) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) (SCRATCH #2) # \ / \ / @@ -2440,10 +2440,10 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6" and "url" set to "" + Given I have a project with "name" set to "project 6" and "url" set to "" When I upload a generated project, API version 1 - And I upload another project with name set to "program 2", url set to "Program 1[/app/project/1],Music Inventor [https://scratch.mit.edu/projects/29495624]" and catrobatLanguageVersion set to "0.993", API version 1 - And I upload another project with name set to "program 4" and url set to "Program 2[/app/project/2]", API version 1 + And I upload another project with name set to "project 2", url set to "Project 1[/app/project/1],Music Inventor [https://scratch.mit.edu/projects/29495624]" and catrobatLanguageVersion set to "0.993", API version 1 + And I upload another project with name set to "project 4" and url set to "Project 2[/app/project/2]", API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 And the uploaded project should have a Catrobat forward ancestor having id "4" and depth "0", API version 1 @@ -2453,7 +2453,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat backward parents, API version 1 And the uploaded project should have no Scratch parents, API version 1 And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 - And the uploaded project should have RemixOf "Program 2[/app/project/2]" in the xml, API version 1 + And the uploaded project should have RemixOf "Project 2[/app/project/2]" in the xml, API version 1 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -2479,7 +2479,7 @@ Feature: Upload a remixed program with multiple parents And the project "2" should have a Catrobat forward descendant having id "5" and depth "2" And the project "2" should have a Catrobat forward descendant having id "7" and depth "3" And the project "2" should have no further Catrobat forward descendants - And the project "2" should have RemixOf "Program 1[/app/project/1],Music Inventor [https://scratch.mit.edu/projects/29495624]" in the xml + And the project "2" should have RemixOf "Project 1[/app/project/1],Music Inventor [https://scratch.mit.edu/projects/29495624]" in the xml And the project "3" should not be a remix root And the project "3" should have a Catrobat forward ancestor having id "3" and depth "0" diff --git a/tests/BehatFeatures/api-deprecated/upload/upload_remixed_program_with_more_parents.feature b/tests/BehatFeatures/api-deprecated/upload/upload_remixed_project_with_more_parents.feature similarity index 86% rename from tests/BehatFeatures/api-deprecated/upload/upload_remixed_program_with_more_parents.feature rename to tests/BehatFeatures/api-deprecated/upload/upload_remixed_project_with_more_parents.feature index c058529e47..757169d52c 100644 --- a/tests/BehatFeatures/api-deprecated/upload/upload_remixed_program_with_more_parents.feature +++ b/tests/BehatFeatures/api-deprecated/upload/upload_remixed_project_with_more_parents.feature @@ -1,5 +1,5 @@ @api @projects @remixes -Feature: Upload a remixed program with multiple parents +Feature: Upload a remixed project with multiple parents Background: Given there are users: @@ -8,15 +8,15 @@ Feature: Upload a remixed program with multiple parents And there are projects: | id | name | description | owned by | downloads | views | upload time | version | remix_root | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | - | 2 | program 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | - | 3 | program 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 4 | program 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | false | - | 5 | program 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | - | 6 | program 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 7 | program 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 8 | program 8 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 9 | program 9 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | + | 2 | project 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | + | 3 | project 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 4 | project 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | false | + | 5 | project 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | + | 6 | project 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 7 | project 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 8 | project 8 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 9 | project 9 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | #------------------------------------------------------------------------------------------------------------------- # this is how the remix graph looks like according to the following forward remix relations (closure table): @@ -65,9 +65,9 @@ Feature: Upload a remixed program with multiple parents | 8 | 9 | 1 | | 9 | 9 | 0 | - Scenario: program upload with parent-URL referring to no existing Catrobat programs should not add any remix relations + Scenario: project upload with parent-URL referring to no existing Catrobat projects should not add any remix relations (except self referencing relation) - Given I have a project with "catrobatLanguageVersion" set to "0.993" and "url" set to "Program 10 [/app/project/10], Program 11 [https://share.catrob.at/app/project/11]" + Given I have a project with "catrobatLanguageVersion" set to "0.993" and "url" set to "Project 10 [/app/project/10], Project 11 [https://share.catrob.at/app/project/11]" When I upload the project with the id "10", API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -75,11 +75,11 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat ancestors except self-relation, API version 1 And the uploaded project should have no Scratch parents, API version 1 And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 - And the uploaded project should have RemixOf "Program 10 [/app/project/10], Program 11 [https://share.catrob.at/app/project/11]" in the xml, API version 1 + And the uploaded project should have RemixOf "Project 10 [/app/project/10], Project 11 [https://share.catrob.at/app/project/11]" in the xml, API version 1 - Scenario: program upload with parent-URL referring to multiple existing Catrobat root programs + Scenario: project upload with parent-URL referring to multiple existing Catrobat root projects but Catrobat language version 0.992 should not add any remix relations (except self referencing relation) - Given I have a project with "catrobatLanguageVersion" set to "0.992" and "url" set to "Program 1 [/app/project/1], Program 8 [https://share.catrob.at/app/project/8]" + Given I have a project with "catrobatLanguageVersion" set to "0.992" and "url" set to "Project 1 [/app/project/1], Project 8 [https://share.catrob.at/app/project/8]" When I upload the project with the id "10", API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -89,9 +89,9 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 And the uploaded project should have RemixOf "" in the xml, API version 1 - Scenario: program upload with parent-URL referring to multiple existing Catrobat root programs + Scenario: project upload with parent-URL referring to multiple existing Catrobat root projects but Catrobat language version 0.991 should not add any remix relations (except self referencing relation) - Given I have a project with "catrobatLanguageVersion" set to "0.991" and "url" set to "Program 1 [/app/project/1], Program 8 [https://share.catrob.at/app/project/8]" + Given I have a project with "catrobatLanguageVersion" set to "0.991" and "url" set to "Project 1 [/app/project/1], Project 8 [https://share.catrob.at/app/project/8]" When I upload the project with the id "10", API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -101,9 +101,9 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 And the uploaded project should have RemixOf "" in the xml, API version 1 - Scenario: program upload with parent-URL referring to multiple existing Catrobat root programs + Scenario: project upload with parent-URL referring to multiple existing Catrobat root projects but Catrobat language version 0.99 should not add any remix relations (except self referencing relation) - Given I have a project with "catrobatLanguageVersion" set to "0.99" and "url" set to "Program 1 [/app/project/1], Program 8 [https://share.catrob.at/app/project/8]" + Given I have a project with "catrobatLanguageVersion" set to "0.99" and "url" set to "Project 1 [/app/project/1], Project 8 [https://share.catrob.at/app/project/8]" When I upload the project with the id "10", API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -113,9 +113,9 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 And the uploaded project should have RemixOf "" in the xml, API version 1 - Scenario: program upload with parent-URL referring to multiple existing Catrobat root programs + Scenario: project upload with parent-URL referring to multiple existing Catrobat root projects but Catrobat language version 0.92 should not add any remix relations (except self referencing relation) - Given I have a project with "catrobatLanguageVersion" set to "0.92" and "url" set to "Program 1 [/app/project/1], Program 8 [https://share.catrob.at/app/project/8]" + Given I have a project with "catrobatLanguageVersion" set to "0.92" and "url" set to "Project 1 [/app/project/1], Project 8 [https://share.catrob.at/app/project/8]" When I upload the project with the id "10", API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -125,13 +125,13 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 And the uploaded project should have RemixOf "" in the xml, API version 1 - Scenario: program upload with parent-URL referring to existing Catrobat root programs and + Scenario: project upload with parent-URL referring to existing Catrobat root projects and Catrobat language version 0.993 should correctly add remix relations #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # (1)______________ (8) # \ \ / \ - # (2)_____ (10) (9) <-- to be added (uploaded program will get ID "10") + # (2)_____ (10) (9) <-- to be added (uploaded project will get ID "10") # / \ \ # (3) (4) | # | \ | | @@ -139,7 +139,7 @@ Feature: Upload a remixed program with multiple parents # \ / # (7) #------------------------------------------------------------------------------------------------------------------- - Given I have a project with "catrobatLanguageVersion" set to "0.993" and "url" set to "Program 1 [/app/project/1], Program 8 [https://share.catrob.at/app/project/8]" + Given I have a project with "catrobatLanguageVersion" set to "0.993" and "url" set to "Project 1 [/app/project/1], Project 8 [https://share.catrob.at/app/project/8]" When I upload the project with the id "10", API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -150,17 +150,17 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat backward parents, API version 1 And the uploaded project should have no Scratch parents, API version 1 And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 - And the uploaded project should have RemixOf "Program 1 [/app/project/1], Program 8 [https://share.catrob.at/app/project/8]" in the xml, API version 1 + And the uploaded project should have RemixOf "Project 1 [/app/project/1], Project 8 [https://share.catrob.at/app/project/8]" in the xml, API version 1 - Scenario: program upload with parent-URL referring only to Scratch programs and + Scenario: project upload with parent-URL referring only to Scratch projects and Catrobat language version 0.999 should correctly add remix relations #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (SCRATCH #1) (SCRATCH #2) # \ / # \ / - # (10) <-- to be added (uploaded program will get ID "10") + # (10) <-- to be added (uploaded project will get ID "10") # #------------------------------------------------------------------------------------------------------------------- Given I have a project with "catrobatLanguageVersion" set to "0.999" and "url" set to "Music Inventor [https://scratch.mit.edu/projects/29495624], The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/]" @@ -175,10 +175,10 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 And the uploaded project should have RemixOf "Music Inventor [https://scratch.mit.edu/projects/29495624], The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/]" in the xml, API version 1 - Scenario: program upload with parent-URL referring to existing Catrobat programs and + Scenario: project upload with parent-URL referring to existing Catrobat projects and Catrobat language version 1 should correctly add remix relations (example #1) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) # \ @@ -190,10 +190,10 @@ Feature: Upload a remixed program with multiple parents # \ / | | # (7) | (9) # | | | - # (10)____/____________/ <-- to be added (uploaded program will get ID "10") + # (10)____/____________/ <-- to be added (uploaded project will get ID "10") # #------------------------------------------------------------------------------------------------------------------- - Given I have a project with "catrobatLanguageVersion" set to "1" and "url" set to "Program 2 [/pocketalice/project/2], Merge 1 [Program 7 [/app/project/7], Program 9 [https://share.catrob.at/app/project/9]]" + Given I have a project with "catrobatLanguageVersion" set to "1" and "url" set to "Project 2 [/pocketalice/project/2], Merge 1 [Project 7 [/app/project/7], Project 9 [https://share.catrob.at/app/project/9]]" When I upload the project with the id "10", API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -215,9 +215,9 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat backward parents, API version 1 And the uploaded project should have no Scratch parents, API version 1 And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 - And the uploaded project should have RemixOf "Program 2 [/pocketalice/project/2], Merge 1 [Program 7 [/app/project/7], Program 9 [https://share.catrob.at/app/project/9]]" in the xml, API version 1 + And the uploaded project should have RemixOf "Project 2 [/pocketalice/project/2], Merge 1 [Project 7 [/app/project/7], Project 9 [https://share.catrob.at/app/project/9]]" in the xml, API version 1 - Scenario: program upload with parent-URL referring to existing Catrobat programs and + Scenario: project upload with parent-URL referring to existing Catrobat projects and Catrobat language version 1.0 should correctly add remix relations (example #2) Given there are Scratch remix relations: | scratch_parent_id | catrobat_child_id | @@ -231,7 +231,7 @@ Feature: Upload a remixed program with multiple parents | 6 | 1 | #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) # \ / @@ -241,12 +241,12 @@ Feature: Upload a remixed program with multiple parents # | \ | | (8) # (5) (6)__/|_____/ \ # \ / \ / (9) - # (7) (10) <-- to be added (uploaded program will get ID "10") + # (7) (10) <-- to be added (uploaded project will get ID "10") # # Note: there are some additional remix backward relations (see table above) not shown in the graph for clarity reasons. - # This test will also check that no backward parents of parent program will be linked to the uploaded program. + # This test will also check that no backward parents of parent project will be linked to the uploaded project. #------------------------------------------------------------------------------------------------------------------- - Given I have a project with "catrobatLanguageVersion" set to "1.0" and "url" set to "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Program 2 [/pocketalice/project/2], Merge 1 [Program 6 [/app/project/6], Program 8 [https://share.catrob.at/app/project/8]]]" + Given I have a project with "catrobatLanguageVersion" set to "1.0" and "url" set to "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Project 2 [/pocketalice/project/2], Merge 1 [Project 6 [/app/project/6], Project 8 [https://share.catrob.at/app/project/8]]]" When I upload the project with the id "10", API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -266,9 +266,9 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Scratch parent having id "70058680", API version 1 And the uploaded project should have no further Scratch parents, API version 1 And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 - And the uploaded project should have RemixOf "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Program 2 [/pocketalice/project/2], Merge 1 [Program 6 [/app/project/6], Program 8 [https://share.catrob.at/app/project/8]]]" in the xml, API version 1 + And the uploaded project should have RemixOf "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Project 2 [/pocketalice/project/2], Merge 1 [Project 6 [/app/project/6], Project 8 [https://share.catrob.at/app/project/8]]]" in the xml, API version 1 - Scenario: program upload with parent-URL referring to existing Catrobat programs and + Scenario: project upload with parent-URL referring to existing Catrobat projects and Catrobat language version 1.1 should correctly add remix relations (example #2) Given there are Scratch remix relations: | scratch_parent_id | catrobat_child_id | @@ -282,7 +282,7 @@ Feature: Upload a remixed program with multiple parents | 6 | 1 | #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) # \ / @@ -292,12 +292,12 @@ Feature: Upload a remixed program with multiple parents # | \ | | (8) # (5) (6)__/|_____/ \ # \ / \ / (9) - # (7) (10) <-- to be added (uploaded program will get ID "10") + # (7) (10) <-- to be added (uploaded project will get ID "10") # # Note: there are some additional remix backward relations (see table above) not shown in the graph for clarity reasons. - # This test will also check that no backward parents of parent program will be linked to the uploaded program. + # This test will also check that no backward parents of parent project will be linked to the uploaded project. #------------------------------------------------------------------------------------------------------------------- - Given I have a project with "catrobatLanguageVersion" set to "1.1" and "url" set to "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Program 2 [/pocketalice/project/2], Merge 1 [Program 6 [/app/project/6], Program 8 [https://share.catrob.at/app/project/8]]]" + Given I have a project with "catrobatLanguageVersion" set to "1.1" and "url" set to "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Project 2 [/pocketalice/project/2], Merge 1 [Project 6 [/app/project/6], Project 8 [https://share.catrob.at/app/project/8]]]" When I upload the project with the id "10", API version 1 Then the uploaded project should not be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -317,4 +317,4 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Scratch parent having id "70058680", API version 1 And the uploaded project should have no further Scratch parents, API version 1 And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 - And the uploaded project should have RemixOf "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Program 2 [/pocketalice/project/2], Merge 1 [Program 6 [/app/project/6], Program 8 [https://share.catrob.at/app/project/8]]]" in the xml, API version 1 + And the uploaded project should have RemixOf "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Project 2 [/pocketalice/project/2], Merge 1 [Project 6 [/app/project/6], Project 8 [https://share.catrob.at/app/project/8]]]" in the xml, API version 1 diff --git a/tests/BehatFeatures/api-deprecated/upload/upload_remixed_program_with_one_parent.feature b/tests/BehatFeatures/api-deprecated/upload/upload_remixed_project_with_one_parent.feature similarity index 90% rename from tests/BehatFeatures/api-deprecated/upload/upload_remixed_program_with_one_parent.feature rename to tests/BehatFeatures/api-deprecated/upload/upload_remixed_project_with_one_parent.feature index 9be929c3ad..57fce82e77 100644 --- a/tests/BehatFeatures/api-deprecated/upload/upload_remixed_program_with_one_parent.feature +++ b/tests/BehatFeatures/api-deprecated/upload/upload_remixed_project_with_one_parent.feature @@ -1,5 +1,5 @@ @api @projects @remixes -Feature: Upload a remixed program with one parent +Feature: Upload a remixed project with one parent Background: Given there are users: @@ -8,15 +8,15 @@ Feature: Upload a remixed program with one parent And there are projects: | id | name | description | owned by | downloads | views | upload time | version | remix_root | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | - | 2 | program 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | - | 3 | program 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 4 | program 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | - | 5 | program 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | - | 6 | program 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 7 | program 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 8 | program 8 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 9 | program 9 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | + | 2 | project 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | + | 3 | project 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 4 | project 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | + | 5 | project 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | + | 6 | project 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 7 | project 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 8 | project 8 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 9 | project 9 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | #------------------------------------------------------------------------------------------------------------------- # this is how the remix graph looks like according to the following forward remix relations (closure table): @@ -35,7 +35,7 @@ Feature: Upload a remixed program with one parent | 2 | 3 | 1 | | 3 | 3 | 0 | - Scenario: program upload with no parent-URL should not add any remix relations (except self referencing relation) + Scenario: project upload with no parent-URL should not add any remix relations (except self referencing relation) Given I have a project with "url" set to "" When I upload the project with the id "10", API version 1 Then the uploaded project should be a remix root, API version 1 @@ -46,8 +46,8 @@ Feature: Upload a remixed program with one parent And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 And the uploaded project should have RemixOf "" in the xml, API version 1 - Scenario: program upload with local program name parent-URL should not add any remix relations (except self referencing relation) - Given I have a project with "url" set to "My first program" + Scenario: project upload with local project name parent-URL should not add any remix relations (except self referencing relation) + Given I have a project with "url" set to "My first project" When I upload the project with the id "10", API version 1 Then the uploaded project should be a remix root, API version 1 And the uploaded project should have remix migration date NOT NULL, API version 1 @@ -55,9 +55,9 @@ Feature: Upload a remixed program with one parent And the uploaded project should have no Catrobat ancestors except self-relation, API version 1 And the uploaded project should have no Scratch parents, API version 1 And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 - And the uploaded project should have RemixOf "My first program" in the xml, API version 1 + And the uploaded project should have RemixOf "My first project" in the xml, API version 1 - Scenario: program upload with invalid parent-URL should not add any remix relations (except self referencing relation) + Scenario: project upload with invalid parent-URL should not add any remix relations (except self referencing relation) Given I have a project with "url" set to "https://www.google.com" When I upload the project with the id "10", API version 1 Then the uploaded project should be a remix root, API version 1 @@ -68,7 +68,7 @@ Feature: Upload a remixed program with one parent And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 And the uploaded project should have RemixOf "https://www.google.com" in the xml, API version 1 - Scenario: program upload with parent-URL referring to own Catrobat program should not add any remix relations + Scenario: project upload with parent-URL referring to own Catrobat project should not add any remix relations (except self referencing relation) Given I have a project with "url" set to "/app/project/10" When I upload the project with the id "10", API version 1 @@ -80,7 +80,7 @@ Feature: Upload a remixed program with one parent And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 And the uploaded project should have RemixOf "/app/project/10" in the xml, API version 1 - Scenario: program upload with parent-URL referring to no existing Catrobat program should not add any remix relations + Scenario: project upload with parent-URL referring to no existing Catrobat project should not add any remix relations (except self referencing relation) Given I have a project with "url" set to "/app/project/11" When I upload the project with the id "10", API version 1 @@ -92,13 +92,13 @@ Feature: Upload a remixed program with one parent And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 And the uploaded project should have RemixOf "/app/project/11" in the xml, API version 1 - Scenario: program upload with parent-URL referring to existing Catrobat non-root program + Scenario: project upload with parent-URL referring to existing Catrobat non-root project should correctly add remix relations (example #1) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # (1) # / \ - # (2) (10) <-- to be added (uploaded program will get ID "10") + # (2) (10) <-- to be added (uploaded project will get ID "10") # | # (3) #------------------------------------------------------------------------------------------------------------------- @@ -114,15 +114,15 @@ Feature: Upload a remixed program with one parent And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 And the uploaded project should have RemixOf "/app/project/1" in the xml, API version 1 - Scenario: program upload with parent-URL referring to existing Catrobat non-root program + Scenario: project upload with parent-URL referring to existing Catrobat non-root project should correctly add remix relations (example #2) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # (1) # | # (2) # / \ - # (3) (10) <-- to be added (uploaded program will get ID "10") + # (3) (10) <-- to be added (uploaded project will get ID "10") #------------------------------------------------------------------------------------------------------------------- Given I have a project with "url" set to "/pocketalice/project/2" When I upload the project with the id "10", API version 1 @@ -136,17 +136,17 @@ Feature: Upload a remixed program with one parent And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 And the uploaded project should have RemixOf "/pocketalice/project/2" in the xml, API version 1 - Scenario: program upload with parent-URL referring to existing Catrobat non-root program + Scenario: project upload with parent-URL referring to existing Catrobat non-root project should correctly add remix relations (example #3) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # (1) # \ # (2) # / # (3) # \ - # (10) <-- to be added (uploaded program will get ID "10") + # (10) <-- to be added (uploaded project will get ID "10") #------------------------------------------------------------------------------------------------------------------- Given I have a project with "url" set to "/pocketalice/project/3" When I upload the project with the id "10", API version 1 @@ -162,13 +162,13 @@ Feature: Upload a remixed program with one parent And the uploaded project should have no Catrobat forward descendants except self-relation, API version 1 And the uploaded project should have RemixOf "/pocketalice/project/3" in the xml, API version 1 - Scenario: program upload with parent-URL referring to Scratch program should correctly add remix relations + Scenario: project upload with parent-URL referring to Scratch project should correctly add remix relations #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (Scratch #70058680) # | - # (10) <-- to be added (uploaded program will get ID "10") + # (10) <-- to be added (uploaded project will get ID "10") # #------------------------------------------------------------------------------------------------------------------- Given I have a project with "url" set to "https://scratch.mit.edu/projects/70058680" @@ -196,7 +196,7 @@ Feature: Upload a remixed program with one parent # | \ / | # \______ (9) _______/ # | - # (10) <-- to be added (uploaded program will get ID "10") + # (10) <-- to be added (uploaded project will get ID "10") # #------------------------------------------------------------------------------------------------------------------- Given there are forward remix relations: @@ -256,7 +256,7 @@ Feature: Upload a remixed program with one parent # \ / | \ | # (5) / (7) | # / \ /__/ | | - # to be added (uploaded program will get ID "10") --> (10) \ / | | + # to be added (uploaded project will get ID "10") --> (10) \ / | | # (6) (8)____/ # \ / # (9) @@ -311,15 +311,15 @@ Feature: Upload a remixed program with one parent # \ / | \ | # (5) / (7) | # \ /__/ | \ | - # \ / | (10) | <-- to be added (uploaded program will get ID "10") + # \ / | (10) | <-- to be added (uploaded project will get ID "10") # (6) (8)____/ # \ / # (9) # - # Note: unlike the previous example there is an additional remix backward relation from program #9 to - # the program #7, in this example. But this is not drawn in the graph above for clarity reasons. - # Since program #7 will be the parent of the uploaded program #10, this test will also check that no ancestors - # of program #9 (including itself) are linked to the uploaded program. + # Note: unlike the previous example there is an additional remix backward relation from project #9 to + # the project #7, in this example. But this is not drawn in the graph above for clarity reasons. + # Since project #7 will be the parent of the uploaded project #10, this test will also check that no ancestors + # of project #9 (including itself) are linked to the uploaded project. #------------------------------------------------------------------------------------------------------------------- Given there are forward remix relations: | ancestor_id | descendant_id | depth | diff --git a/tests/BehatFeatures/api-deprecated/upload/upload_validation.feature b/tests/BehatFeatures/api-deprecated/upload/upload_validation.feature index 5de85d8800..9f660acefc 100644 --- a/tests/BehatFeatures/api-deprecated/upload/upload_validation.feature +++ b/tests/BehatFeatures/api-deprecated/upload/upload_validation.feature @@ -1,17 +1,17 @@ @api @upload -Feature: All uploaded programs have to be validated. +Feature: All uploaded projects have to be validated. Background: Given I am a valid user - Scenario: program must have a code.xml + Scenario: project must have a code.xml When I upload a project with "a missing code.xml", API version 1 Then I should get the json object: """ {"statusCode":507,"answer":"unknown error: project_xml_not_found!","preHeaderMessages":""} """ - Scenario: program must have a valid code.xml + Scenario: project must have a valid code.xml When I upload a project with "an invalid code.xml", API version 1 Then I should get the json object: """ @@ -20,7 +20,7 @@ Feature: All uploaded programs have to be validated. And the response code should be "200" @disabled - Scenario: program with missing images are rejected + Scenario: project with missing images are rejected When I upload a project with "a missing image", API version 1 Then I should get the json object: """ @@ -28,7 +28,7 @@ Feature: All uploaded programs have to be validated. """ @disabled - Scenario: program with media files not defined in xml are rejected + Scenario: project with media files not defined in xml are rejected When I upload a project with "an additional image", API version 1 Then I should get the json object: """ @@ -36,14 +36,14 @@ Feature: All uploaded programs have to be validated. """ And the response code should be "500" - Scenario: invalid catrobat program files should be rejected + Scenario: invalid catrobat project files should be rejected When I upload an invalid project file, API version 1 Then I should get the json object: """ {"statusCode":505,"answer":"invalid file","preHeaderMessages":""} """ - Scenario Outline: user should not be able to upload a program with an old pocketcode version + Scenario Outline: user should not be able to upload a project with an old pocketcode version Given I am using pocketcode for "" with version "" When I upload a generated project, API version 1 Then I should get the json object: @@ -57,7 +57,7 @@ Feature: All uploaded programs have to be validated. | Windows | 0.0.1 | | iOS | 0.0.1 | - Scenario Outline: user should not be able to upload a program with an old pocketcode version + Scenario Outline: user should not be able to upload a project with an old pocketcode version Given I am using pocketcode for "" with version "" When I upload a generated project, API version 1 Then the uploaded project should exist in the database, API version 1 @@ -70,7 +70,7 @@ Feature: All uploaded programs have to be validated. | iOS | 0.1.0 | - Scenario: user should not be able to upload a program with an old language version + Scenario: user should not be able to upload a project with an old language version Given I am using pocketcode with language version "0.7" When I upload a generated project, API version 1 Then I should get the json object: @@ -82,4 +82,4 @@ Feature: All uploaded programs have to be validated. Scenario: All media files except screenshots have to be defined in code.xml - Scenario: A program must have a name. + Scenario: A project must have a name. diff --git a/tests/BehatFeatures/api/projects/GET_project_id_catrobat/download_program.feature b/tests/BehatFeatures/api/projects/GET_project_id_catrobat/download_project.feature similarity index 89% rename from tests/BehatFeatures/api/projects/GET_project_id_catrobat/download_program.feature rename to tests/BehatFeatures/api/projects/GET_project_id_catrobat/download_project.feature index 473423e147..d4d392938e 100644 --- a/tests/BehatFeatures/api/projects/GET_project_id_catrobat/download_program.feature +++ b/tests/BehatFeatures/api/projects/GET_project_id_catrobat/download_project.feature @@ -1,5 +1,5 @@ @api -Feature: Download programs +Feature: Download projects Background: Given there are users: @@ -7,9 +7,9 @@ Feature: Download programs | Catrobat | 12345 | cccccccccc | 1 | And there are downloadable projects: | id | name | description | owned by | downloads | views | upload time | version | visible | private | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | false | - | 2 | program 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | false | - | 3 | program 3 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | true | true | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | false | + | 2 | project 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | false | + | 3 | project 3 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | true | true | Scenario: Projects can be downloaded When I request "GET" "/api/project/1/catrobat" diff --git a/tests/BehatFeatures/api/projects/GET_projects/recommended_category.feature b/tests/BehatFeatures/api/projects/GET_projects/recommended_category.feature index c3353dbb24..5fbd30b27a 100644 --- a/tests/BehatFeatures/api/projects/GET_projects/recommended_category.feature +++ b/tests/BehatFeatures/api/projects/GET_projects/recommended_category.feature @@ -1,8 +1,8 @@ @api @disabled -Feature: Get recommended programs on homepage +Feature: Get recommended projects on homepage - To find yet unliked programs that were liked by similar users. - Similar users are users that liked some of the same programs that the current user also liked + To find yet unliked projects that were liked by similar users. + Similar users are users that liked some of the same projects that the current user also liked (user-based Collaborative Filtering using Jaccard distance as similarity measure). Background: diff --git a/tests/BehatFeatures/api/projects/GET_projects/scratch_remix_category.feature b/tests/BehatFeatures/api/projects/GET_projects/scratch_remix_category.feature index 670cdab556..72181040fc 100644 --- a/tests/BehatFeatures/api/projects/GET_projects/scratch_remix_category.feature +++ b/tests/BehatFeatures/api/projects/GET_projects/scratch_remix_category.feature @@ -1,5 +1,5 @@ @api @projects -Feature: Get remixed program from Scratch +Feature: Get remixed project from Scratch Background: Given there are users: @@ -8,17 +8,17 @@ Feature: Get remixed program from Scratch And there are projects: | id | name | owned by | views | version | remix_root | - | 1 | program 1 | Catrobat | 14 | 0.8.5 | true | - | 2 | program 2 | Catrobat | 9 | 0.8.5 | false | - | 3 | program 3 | Catrobat | 33 | 0.8.5 | false | - | 4 | program 4 | Catrobat | 15 | 0.8.5 | true | - | 5 | program 5 | Catrobat | 7 | 0.8.5 | false | - | 6 | program 6 | Catrobat | 30 | 0.8.5 | false | - | 7 | program 7 | Catrobat | 35 | 0.8.5 | false | - | 8 | program 8 | Catrobat | 30 | 0.8.5 | false | - | 9 | program 9 | Catrobat | 38 | 0.8.5 | false | - | 10 | program 10 | Catrobat | 38 | 0.8.5 | false | - | 11 | program 11 | Catrobat | 38 | 0.8.5 | false | + | 1 | project 1 | Catrobat | 14 | 0.8.5 | true | + | 2 | project 2 | Catrobat | 9 | 0.8.5 | false | + | 3 | project 3 | Catrobat | 33 | 0.8.5 | false | + | 4 | project 4 | Catrobat | 15 | 0.8.5 | true | + | 5 | project 5 | Catrobat | 7 | 0.8.5 | false | + | 6 | project 6 | Catrobat | 30 | 0.8.5 | false | + | 7 | project 7 | Catrobat | 35 | 0.8.5 | false | + | 8 | project 8 | Catrobat | 30 | 0.8.5 | false | + | 9 | project 9 | Catrobat | 38 | 0.8.5 | false | + | 10 | project 10 | Catrobat | 38 | 0.8.5 | false | + | 11 | project 11 | Catrobat | 38 | 0.8.5 | false | Given there are Scratch remix relations: | scratch_parent_id | catrobat_child_id | @@ -28,7 +28,7 @@ Feature: Get remixed program from Scratch | 70058680 | 8 | | 70058680 | 9 | - Scenario: show scratch remixes programs with limit and offset + Scenario: show scratch remixes projects with limit and offset Given I have a parameter "limit" with value "5" And I have a parameter "offset" with value "0" And I have a parameter "category" with value "scratch" @@ -38,25 +38,25 @@ Feature: Get remixed program from Scratch Then the response should have the default projects model structure Then the response should contain projects in the following order: | Name | - | program 9 | - | program 7 | - | program 6 | - | program 8 | - | program 5 | + | project 9 | + | project 7 | + | project 6 | + | project 8 | + | project 5 | - Scenario: program upload with parent-URL referring only to Scratch programs and + Scenario: project upload with parent-URL referring only to Scratch projects and Catrobat language version 0.999 should correctly add remix relations #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (SCRATCH #1) (SCRATCH #2) # \ / # \ / - # (10) <-- to be added (uploaded program will get ID "10") + # (10) <-- to be added (uploaded project will get ID "10") # #------------------------------------------------------------------------------------------------------------------- Given I have a project with "catrobatLanguageVersion" set to "0.999" and "url" set to "Music Inventor [https://scratch.mit.edu/projects/29495624], The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/]" - When I upload the generated project with the id "18" and name "program 18", API version 2 + When I upload the generated project with the id "18" and name "project 18", API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 And the uploaded project should have a Catrobat forward ancestor having its own id and depth "0", API version 2 @@ -75,14 +75,14 @@ Feature: Get remixed program from Scratch Then the response should have the default projects model structure Then the response should contain projects in the following order: | Name | - | program 9 | - | program 7 | - | program 6 | - | program 8 | - | program 5 | - | program 18 | + | project 9 | + | project 7 | + | project 6 | + | project 8 | + | project 5 | + | project 18 | - Scenario: program upload with parent-URL referring to existing Catrobat programs and + Scenario: project upload with parent-URL referring to existing Catrobat projects and Catrobat language version 1.0 should correctly add remix relations (example #2) Given there are Scratch remix relations: | scratch_parent_id | catrobat_child_id | @@ -95,15 +95,15 @@ Feature: Get remixed program from Scratch | 6 | 4 | | 6 | 1 | - Given I have a project with "catrobatLanguageVersion" set to "1.0" and "url" set to "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Program 2 [/pocketalice/project/2], Merge 1 [Program 6 [/app/project/6], Program 8 [https://share.catrob.at/app/project/8]]]" - When I upload the generated project with the id "18" and name "program 18", API version 2 + Given I have a project with "catrobatLanguageVersion" set to "1.0" and "url" set to "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Project 2 [/pocketalice/project/2], Merge 1 [Project 6 [/app/project/6], Project 8 [https://share.catrob.at/app/project/8]]]" + When I upload the generated project with the id "18" and name "project 18", API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 And the uploaded project should have a Catrobat forward ancestor having its own id and depth "0", API version 2 And the uploaded project should have no Catrobat backward parents, API version 2 And the uploaded project should have a Scratch parent having id "70058680", API version 2 And the uploaded project should have no further Scratch parents, API version 2 And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 - And the uploaded project should have RemixOf "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Program 2 [/pocketalice/project/2], Merge 1 [Program 6 [/app/project/6], Program 8 [https://share.catrob.at/app/project/8]]]" in the xml, API version 2 + And the uploaded project should have RemixOf "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Project 2 [/pocketalice/project/2], Merge 1 [Project 6 [/app/project/6], Project 8 [https://share.catrob.at/app/project/8]]]" in the xml, API version 2 Given I have a parameter "limit" with value "9" And I have a parameter "offset" with value "0" And I have a parameter "category" with value "scratch" @@ -113,14 +113,14 @@ Feature: Get remixed program from Scratch Then the response should have the default projects model structure Then the response should contain projects in the following order: | Name | - | program 10 | - | program 11 | - | program 9 | - | program 7 | - | program 6 | - | program 8 | - | program 5 | - | program 18 | + | project 10 | + | project 11 | + | project 9 | + | project 7 | + | project 6 | + | project 8 | + | project 5 | + | project 18 | diff --git a/tests/BehatFeatures/api/projects/GET_projects_search/search_projects.feature b/tests/BehatFeatures/api/projects/GET_projects_search/search_projects.feature index 41cd5c1bc1..63798fedf0 100644 --- a/tests/BehatFeatures/api/projects/GET_projects_search/search_projects.feature +++ b/tests/BehatFeatures/api/projects/GET_projects_search/search_projects.feature @@ -1,7 +1,7 @@ @api @projects Feature: Search projects - To find programs, users should be able to search all available programs for specific words + To find projects, users should be able to search all available projects for specific words Background: Given there are users: diff --git a/tests/BehatFeatures/api/projects/POST_projects/projects_post_embroidery.feature b/tests/BehatFeatures/api/projects/POST_projects/projects_post_embroidery.feature index 739ba545d3..82164570b0 100644 --- a/tests/BehatFeatures/api/projects/POST_projects/projects_post_embroidery.feature +++ b/tests/BehatFeatures/api/projects/POST_projects/projects_post_embroidery.feature @@ -1,5 +1,5 @@ @api @projects @post @tag -Feature: Upload a program with tag +Feature: Upload a project with tag Background: Given there are extensions: @@ -11,13 +11,13 @@ Feature: Upload a program with tag | 5 | raspberry_pi | | 6 | embroidery | - Scenario: uploading a embroidery program should add the embroidery extension to the program + Scenario: uploading a embroidery project should add the embroidery extension to the project Given I have an embroidery project And I use the "english" app, API version 2 When I upload this generated project, API version 2 Then the embroidery project should have the "embroidery" file extension - Scenario: uploading a normal program should must not add an extension to the program + Scenario: uploading a normal project should must not add an extension to the project Given I have a project And I use the "english" app, API version 2 When I upload this generated project, API version 2 diff --git a/tests/BehatFeatures/api/projects/POST_projects/projects_post_extensions.feature b/tests/BehatFeatures/api/projects/POST_projects/projects_post_extensions.feature index 9f059f44eb..4ccc1c0b5d 100644 --- a/tests/BehatFeatures/api/projects/POST_projects/projects_post_extensions.feature +++ b/tests/BehatFeatures/api/projects/POST_projects/projects_post_extensions.feature @@ -1,5 +1,5 @@ @api @projects @post @extensions -Feature: Upload a program with extensions +Feature: Upload a project with extensions Background: Given there are users: @@ -7,7 +7,7 @@ Feature: Upload a program with extensions | id | Catrobat | 12345 | And there are projects: | id | name | description | owned by | downloads | views | upload time | version | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | And there are extensions: | id | internal_title | | 1 | arduino | @@ -16,12 +16,12 @@ Feature: Upload a program with extensions | 4 | phiro | | 5 | raspberry_pi | - Scenario: upload a program with extensions + Scenario: upload a project with extensions Given I have a project with arduino, mindstorms and phiro extensions And I upload this generated project with id "2", API version 2 Then the project with id "2" should be marked with "3" extensions in the database - Scenario: update a program with extensions + Scenario: update a project with extensions Given I have a project with arduino, mindstorms and phiro extensions And I upload this generated project with id "2", API version 2 When I upload this generated project again without extensions, API version 2 diff --git a/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_again.feature b/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_again.feature index 67b2e81995..8db3703af5 100644 --- a/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_again.feature +++ b/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_again.feature @@ -1,5 +1,5 @@ @api @projects @post @remixes @repost -Feature: Upload a remixed program with multiple parents +Feature: Upload a remixed project with multiple parents Background: Given there are users: @@ -8,13 +8,13 @@ Feature: Upload a remixed program with multiple parents And there are projects: | id | name | description | owned by | downloads | views | upload time | version | remix_root | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | - | 2 | program 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | true | - | 3 | program 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | true | - | 4 | program 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | false | - | 5 | program 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | - | 6 | program 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 7 | program 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | + | 2 | project 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | true | + | 3 | project 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | true | + | 4 | project 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | false | + | 5 | project 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | + | 6 | project 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 7 | project 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | #------------------------------------------------------------------------------------------------------------------- # this is how the remix graph looks like according to the following forward remix relations (closure table): @@ -58,9 +58,9 @@ Feature: Upload a remixed program with multiple parents | 29495624 | 5 | | 29495624 | 7 | - Scenario: reuploading program 4 with only one parent unlinks former parent + Scenario: reuploading project 4 with only one parent unlinks former parent #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (2) (3) (Scratch) (1) (2) (3) (Scratch) # \ / / / \ / / @@ -72,7 +72,7 @@ Feature: Upload a remixed program with multiple parents # #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 4" and "url" set to "program 1[/pocketalice/project/1]" + Given I have a project with "name" set to "project 4" and "url" set to "project 1[/pocketalice/project/1]" When I upload this generated project, API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -84,7 +84,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "1", API version 2 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "program 1[/pocketalice/project/1]" in the xml, API version 2 + And the uploaded project should have RemixOf "project 1[/pocketalice/project/1]" in the xml, API version 2 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -149,9 +149,9 @@ Feature: Upload a remixed program with multiple parents And the project "7" should have no further Scratch parents And the project "7" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 6 with only one parent unlinks former parent + Scenario: reuploading project 6 with only one parent unlinks former parent #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (2) (3) (Scratch) (1) (2) (3) (Scratch) # \ / / / \ / / / @@ -163,7 +163,7 @@ Feature: Upload a remixed program with multiple parents # #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6" and "url" set to "program 5[/pocketalice/project/5]" + Given I have a project with "name" set to "project 6" and "url" set to "project 5[/pocketalice/project/5]" When I upload this generated project, API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -175,7 +175,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Scratch parents, API version 2 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "1", API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "program 5[/pocketalice/project/5]" in the xml, API version 2 + And the uploaded project should have RemixOf "project 5[/pocketalice/project/5]" in the xml, API version 2 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -234,9 +234,9 @@ Feature: Upload a remixed program with multiple parents And the project "7" should have no further Scratch parents And the project "7" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 6 with additional backward parent creates backward relation and unlinks former parent + Scenario: reuploading project 6 with additional backward parent creates backward relation and unlinks former parent #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (2) (3) (Scratch) (1) (2) (3) (Scratch) # \ / / / \ / / / @@ -247,10 +247,10 @@ Feature: Upload a remixed program with multiple parents # (7)_______/ (7)_______/ # #------------------------------------------------------------------------------------------------------------------- - # Expected result after upload: program 7 becomes a backward parent of program 6 as well! + # Expected result after upload: project 7 becomes a backward parent of project 6 as well! #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6", "url" set to "program 6[/app/project/6], Merge 1[program 5[/pocketalice/project/5], program 7[/pocketalice/project/7]]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 6", "url" set to "project 6[/app/project/6], Merge 1[project 5[/pocketalice/project/5], project 7[/pocketalice/project/7]]" and "catrobatLanguageVersion" set to "0.993" When I upload this generated project, API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -263,7 +263,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Scratch parents, API version 2 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "1", API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "program 6[/app/project/6], Merge 1[program 5[/pocketalice/project/5], program 7[/pocketalice/project/7]]" in the xml, API version 2 + And the uploaded project should have RemixOf "project 6[/app/project/6], Merge 1[project 5[/pocketalice/project/5], project 7[/pocketalice/project/7]]" in the xml, API version 2 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -322,10 +322,10 @@ Feature: Upload a remixed program with multiple parents And the project "7" should have no further Scratch parents And the project "7" should have no Catrobat forward descendants except self-relation - Scenario: reuploading former root program 1 with two new Scratch parents and one additional backward parent + Scenario: reuploading former root project 1 with two new Scratch parents and one additional backward parent creates backward relation and two new Scratch relations #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (Scratch #2) (Scratch #1) # \ ___________________/ @@ -339,10 +339,10 @@ Feature: Upload a remixed program with multiple parents # (7)_______/ (7)_______/ # #------------------------------------------------------------------------------------------------------------------- - # Expected result after upload: program 6 becomes a backward parent of program 1 as well! + # Expected result after upload: project 6 becomes a backward parent of project 1 as well! #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 1", "url" set to "Test Scratch [https://scratch.mit.edu/projects/1], Merge1[program 6[/app/project/6], Music Inventor [https://scratch.mit.edu/projects/29495624]]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 1", "url" set to "Test Scratch [https://scratch.mit.edu/projects/1], Merge1[project 6[/app/project/6], Music Inventor [https://scratch.mit.edu/projects/29495624]]" and "catrobatLanguageVersion" set to "0.993" When I upload this generated project, API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -357,7 +357,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "2", API version 2 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "3", API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "Test Scratch [https://scratch.mit.edu/projects/1], Merge1[program 6[/app/project/6], Music Inventor [https://scratch.mit.edu/projects/29495624]]" in the xml, API version 2 + And the uploaded project should have RemixOf "Test Scratch [https://scratch.mit.edu/projects/1], Merge1[project 6[/app/project/6], Music Inventor [https://scratch.mit.edu/projects/29495624]]" in the xml, API version 2 And the project "2" should be a remix root And the project "2" should have a Catrobat forward ancestor having id "2" and depth "0" @@ -428,10 +428,10 @@ Feature: Upload a remixed program with multiple parents And the project "7" should have no further Scratch parents And the project "7" should have no Catrobat forward descendants except self-relation - Scenario: reuploading former root program 1 with one new Scratch parent and one additional backward parent + Scenario: reuploading former root project 1 with one new Scratch parent and one additional backward parent creates backward relation and new Scratch relation #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (Scratch) # ___________________/ @@ -445,10 +445,10 @@ Feature: Upload a remixed program with multiple parents # (7)_______/ (7)_______/ # #------------------------------------------------------------------------------------------------------------------- - # Expected result after upload: program 7 becomes a backward parent of program 1 as well! + # Expected result after upload: project 7 becomes a backward parent of project 1 as well! #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 1", "url" set to "program 7[/app/project/7], Music Inventor [https://scratch.mit.edu/projects/29495624]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 1", "url" set to "project 7[/app/project/7], Music Inventor [https://scratch.mit.edu/projects/29495624]" and "catrobatLanguageVersion" set to "0.993" When I upload this generated project, API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -462,7 +462,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "2", API version 2 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "3", API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "program 7[/app/project/7], Music Inventor [https://scratch.mit.edu/projects/29495624]" in the xml, API version 2 + And the uploaded project should have RemixOf "project 7[/app/project/7], Music Inventor [https://scratch.mit.edu/projects/29495624]" in the xml, API version 2 And the project "2" should be a remix root And the project "2" should have a Catrobat forward ancestor having id "2" and depth "0" @@ -533,10 +533,10 @@ Feature: Upload a remixed program with multiple parents And the project "7" should have no further Scratch parents And the project "7" should have no Catrobat forward descendants except self-relation - Scenario: reuploading former root program 1 with program 5 as forward parent appends program 1 accordingly and - inherits all ancestors of program 5 to program 1 + Scenario: reuploading former root project 1 with project 5 as forward parent appends project 1 accordingly and + inherits all ancestors of project 5 to project 1 #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (3) (Scratch) # \ / \ @@ -552,7 +552,7 @@ Feature: Upload a remixed program with multiple parents # #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 1" and "url" set to "program 5[/app/project/5]" + Given I have a project with "name" set to "project 1" and "url" set to "project 5[/app/project/5]" When I upload this generated project, API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -566,7 +566,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "2", API version 2 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "3", API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "program 5[/app/project/5]" in the xml, API version 2 + And the uploaded project should have RemixOf "project 5[/app/project/5]" in the xml, API version 2 And the project "2" should be a remix root And the project "2" should have a Catrobat forward ancestor having id "2" and depth "0" diff --git a/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_again_complex.feature b/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_again_complex.feature index 069366b83a..a22f5288e5 100644 --- a/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_again_complex.feature +++ b/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_again_complex.feature @@ -1,5 +1,5 @@ @api @projects @post @remixes @repost -Feature: Upload a remixed program with multiple parents +Feature: Upload a remixed project with multiple parents Background: Given there are users: @@ -8,15 +8,15 @@ Feature: Upload a remixed program with multiple parents And there are projects: | id | name | description | owned by | downloads | views | upload time | version | remix_root | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | - | 2 | program 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | - | 3 | program 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 4 | program 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | false | - | 5 | program 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | - | 6 | program 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 7 | program 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 8 | program 8 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | true | - | 9 | program 9 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | + | 2 | project 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | + | 3 | project 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 4 | project 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | false | + | 5 | project 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | + | 6 | project 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 7 | project 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 8 | project 8 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | true | + | 9 | project 9 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | #------------------------------------------------------------------------------------------------------------------- # this is how the remix graph looks like according to the following forward remix relations (closure table): @@ -80,9 +80,9 @@ Feature: Upload a remixed program with multiple parents | 6 | 4 | | 6 | 2 | - Scenario: reuploading program 2 with no parent-URLs should unlink all former remix ancestors (except self referencing relation) + Scenario: reuploading project 2 with no parent-URLs should unlink all former remix ancestors (except self referencing relation) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / @@ -96,7 +96,7 @@ Feature: Upload a remixed program with multiple parents # #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 2" and "url" set to "" + Given I have a project with "name" set to "project 2" and "url" set to "" When I upload this generated project, API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -195,10 +195,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 2 with parent-URLs referring to no existing Catrobat programs should unlink all former + Scenario: reuploading project 2 with parent-URLs referring to no existing Catrobat projects should unlink all former remix ancestors (except self referencing relation) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / @@ -212,7 +212,7 @@ Feature: Upload a remixed program with multiple parents # #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 2", "url" set to "Program 10 [/app/project/10], Program 11 [https://share.catrob.at/app/project/11]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 2", "url" set to "Project 10 [/app/project/10], Project 11 [https://share.catrob.at/app/project/11]" and "catrobatLanguageVersion" set to "0.993" When I upload this generated project, API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -227,7 +227,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 2 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "3", API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "Program 10 [/app/project/10], Program 11 [https://share.catrob.at/app/project/11]" in the xml, API version 2 + And the uploaded project should have RemixOf "Project 10 [/app/project/10], Project 11 [https://share.catrob.at/app/project/11]" in the xml, API version 2 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -311,10 +311,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 2 with parent-URL referring only to Scratch program should unlink all former + Scenario: reuploading project 2 with parent-URL referring only to Scratch project should unlink all former Catrobat remix ancestors (except self referencing relation) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / @@ -328,7 +328,7 @@ Feature: Upload a remixed program with multiple parents # #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 2" and "url" set to "Music Inventor [https://scratch.mit.edu/projects/29495624]" + Given I have a project with "name" set to "project 2" and "url" set to "Music Inventor [https://scratch.mit.edu/projects/29495624]" When I upload this generated project, API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -428,10 +428,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 2 with parent-URLs referring only to Scratch program but no valid Catrobat programs should + Scenario: reuploading project 2 with parent-URLs referring only to Scratch project but no valid Catrobat projects should unlink all former Catrobat remix ancestors (except self referencing relation) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / @@ -445,7 +445,7 @@ Feature: Upload a remixed program with multiple parents # #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 2", "url" set to "Program 10 [/app/project/10], Music Inventor [https://scratch.mit.edu/projects/29495624]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 2", "url" set to "Project 10 [/app/project/10], Music Inventor [https://scratch.mit.edu/projects/29495624]" and "catrobatLanguageVersion" set to "0.993" When I upload this generated project, API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -461,7 +461,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 2 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "3", API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "Program 10 [/app/project/10], Music Inventor [https://scratch.mit.edu/projects/29495624]" in the xml, API version 2 + And the uploaded project should have RemixOf "Project 10 [/app/project/10], Music Inventor [https://scratch.mit.edu/projects/29495624]" in the xml, API version 2 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -545,9 +545,9 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 4 with same parent-URLs should change remix graph + Scenario: reuploading project 4 with same parent-URLs should change remix graph #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -564,7 +564,7 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 4", "url" set to "Program 2 [/app/project/2], Program 6 [/app/project/6]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 4", "url" set to "Project 2 [/app/project/2], Project 6 [/app/project/6]" and "catrobatLanguageVersion" set to "0.993" When I upload this generated project, API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -577,7 +577,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "1", API version 2 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "Program 2 [/app/project/2], Program 6 [/app/project/6]" in the xml, API version 2 + And the uploaded project should have RemixOf "Project 2 [/app/project/2], Project 6 [/app/project/6]" in the xml, API version 2 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -680,10 +680,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 4 with parent-URLs referring only to its Catrobat forward ancestor (program 2) should - unlink its Catrobat backward parent (program 6) + Scenario: reuploading project 4 with parent-URLs referring only to its Catrobat forward ancestor (project 2) should + unlink its Catrobat backward parent (project 6) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -700,7 +700,7 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 4" and "url" set to "Program 2 [/app/project/2]" + Given I have a project with "name" set to "project 4" and "url" set to "Project 2 [/app/project/2]" When I upload this generated project, API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -713,7 +713,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "1", API version 2 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "Program 2 [/app/project/2]" in the xml, API version 2 + And the uploaded project should have RemixOf "Project 2 [/app/project/2]" in the xml, API version 2 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -816,10 +816,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 4 with only backward parent (program 6) should only + Scenario: reuploading project 4 with only backward parent (project 6) should only unlink all former Catrobat forward ancestors #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -837,7 +837,7 @@ Feature: Upload a remixed program with multiple parents # Expected result after upload: 6 should remain being backward parent of 4 and 2. #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 4" and "url" set to "Program 6 [/app/project/6]" + Given I have a project with "name" set to "project 4" and "url" set to "Project 6 [/app/project/6]" When I upload this generated project, API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -849,7 +849,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "1", API version 2 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "Program 6 [/app/project/6]" in the xml, API version 2 + And the uploaded project should have RemixOf "Project 6 [/app/project/6]" in the xml, API version 2 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -950,9 +950,9 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 3 with child program (program 6) as new parent should create backward relation + Scenario: reuploading project 3 with child project (project 6) as new parent should create backward relation #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -968,7 +968,7 @@ Feature: Upload a remixed program with multiple parents # Expected result after upload: 6 should become backward parent of 3, as 6 is already a child before upload! #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 3" and "url" set to "Program 6 [/app/project/6]" + Given I have a project with "name" set to "project 3" and "url" set to "Project 6 [/app/project/6]" When I upload this generated project, API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -981,7 +981,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "1", API version 2 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "Program 6 [/app/project/6]" in the xml, API version 2 + And the uploaded project should have RemixOf "Project 6 [/app/project/6]" in the xml, API version 2 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -1078,10 +1078,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 3 with child program (program 6) as only parent should create backward relation and + Scenario: reuploading project 3 with child project (project 6) as only parent should create backward relation and remove all former forward ancestors #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -1097,7 +1097,7 @@ Feature: Upload a remixed program with multiple parents # Expected result after upload: 7 should become backward parent of 3, as 7 is already a descendant of 3 before upload! #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 3" and "url" set to "Program 7 [/app/project/7]" + Given I have a project with "name" set to "project 3" and "url" set to "Project 7 [/app/project/7]" When I upload this generated project, API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -1110,7 +1110,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "6" and depth "1", API version 2 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "Program 7 [/app/project/7]" in the xml, API version 2 + And the uploaded project should have RemixOf "Project 7 [/app/project/7]" in the xml, API version 2 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -1207,10 +1207,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 2 with other Scratch program and child programs (program 6 and 7) + Scenario: reuploading project 2 with other Scratch project and child projects (project 6 and 7) as additional parents should create backward relations and replace old Scratch parent with new Scratch parent #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) (SCRATCH #2) # \ / \ _______________/| @@ -1226,7 +1226,7 @@ Feature: Upload a remixed program with multiple parents # Expected result after upload: 6 and 7 should be a backward parent of 2. #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 2", "url" set to "Program 6[https://share.catrob.at/app/project/6],Program 7[/pocketalice/project/7/], Merge 1[Program 1 [/flavors/project/1], The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 2", "url" set to "Project 6[https://share.catrob.at/app/project/6],Project 7[/pocketalice/project/7/], Merge 1[Project 1 [/flavors/project/1], The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]]" and "catrobatLanguageVersion" set to "0.993" When I upload this generated project, API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -1246,7 +1246,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "7" and depth "2", API version 2 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "3", API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "Program 6[https://share.catrob.at/app/project/6],Program 7[/pocketalice/project/7/], Merge 1[Program 1 [/flavors/project/1], The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]]" in the xml, API version 2 + And the uploaded project should have RemixOf "Project 6[https://share.catrob.at/app/project/6],Project 7[/pocketalice/project/7/], Merge 1[Project 1 [/flavors/project/1], The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]]" in the xml, API version 2 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -1344,9 +1344,9 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading root program 2 becomes backward child of all of its child programs + Scenario: reuploading root project 2 becomes backward child of all of its child projects #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -1359,10 +1359,10 @@ Feature: Upload a remixed program with multiple parents # (7) (7) # #------------------------------------------------------------------------------------------------------------------- - # Expected result after upload: all Catrobat childs (2, 3, 4, 5, 6 and 7) become backward parent of program 1 + # Expected result after upload: all Catrobat childs (2, 3, 4, 5, 6 and 7) become backward parent of project 1 #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 1", "url" set to "program 1[/pocketalice/project/1],Merge 4 [program 7[/pocketalice/project/7], Merge3 [Program 6[/app/project/6], Merge 2[Program 5[https://share.catrob.at/app/project/5],Program 4[/pocketalice/project/4], Merge 1[Program 2 [/flavors/project/2], Program 3 [/flavors/project/3]]]]]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 1", "url" set to "project 1[/pocketalice/project/1],Merge 4 [project 7[/pocketalice/project/7], Merge3 [Project 6[/app/project/6], Merge 2[Project 5[https://share.catrob.at/app/project/5],Project 4[/pocketalice/project/4], Merge 1[Project 2 [/flavors/project/2], Project 3 [/flavors/project/3]]]]]" and "catrobatLanguageVersion" set to "0.993" When I upload this generated project, API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -1385,7 +1385,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "7" and depth "3", API version 2 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "4", API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "program 1[/pocketalice/project/1],Merge 4 [program 7[/pocketalice/project/7], Merge3 [Program 6[/app/project/6], Merge 2[Program 5[https://share.catrob.at/app/project/5],Program 4[/pocketalice/project/4], Merge 1[Program 2 [/flavors/project/2], Program 3 [/flavors/project/3]]]]]" in the xml, API version 2 + And the uploaded project should have RemixOf "project 1[/pocketalice/project/1],Merge 4 [project 7[/pocketalice/project/7], Merge3 [Project 6[/app/project/6], Merge 2[Project 5[https://share.catrob.at/app/project/5],Project 4[/pocketalice/project/4], Merge 1[Project 2 [/flavors/project/2], Project 3 [/flavors/project/3]]]]]" in the xml, API version 2 And the project "2" should not be a remix root And the project "2" should have a Catrobat forward ancestor having id "2" and depth "0" @@ -1485,9 +1485,9 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 2 with new parent (program 9) should inherit all its forward relations + Scenario: reuploading project 2 with new parent (project 9) should inherit all its forward relations #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # (8) # | # (9) @@ -1503,10 +1503,10 @@ Feature: Upload a remixed program with multiple parents # (7) (7) # #------------------------------------------------------------------------------------------------------------------- - # Expected result after upload: all Catrobat childs (2, 3, 4, 5, 6 and 7) become backward parent of program 1 + # Expected result after upload: all Catrobat childs (2, 3, 4, 5, 6 and 7) become backward parent of project 1 #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 1" and "url" set to "program 9[/pocketalice/project/9]" + Given I have a project with "name" set to "project 1" and "url" set to "project 9[/pocketalice/project/9]" When I upload this generated project, API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -1525,7 +1525,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Catrobat forward descendant having id "7" and depth "3", API version 2 And the uploaded project should have a Catrobat forward descendant having id "7" and depth "4", API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "program 9[/pocketalice/project/9]" in the xml, API version 2 + And the uploaded project should have RemixOf "project 9[/pocketalice/project/9]" in the xml, API version 2 And the project "2" should not be a remix root And the project "2" should have a Catrobat forward ancestor having id "2" and depth "0" @@ -1659,10 +1659,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have a Catrobat forward descendant having id "7" and depth "5" And the project "9" should have no further Catrobat forward descendants - Scenario: reuploading program 6 with one less parent (program 3) should unlink only forward relation to program 3 + Scenario: reuploading project 6 with one less parent (project 3) should unlink only forward relation to project 3 but not deeper forward relations since these forward relations (1-6 and 2-6) are still needed #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -1679,7 +1679,7 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6", "url" set to "Merge 1[Program 4 [/app/project/4], Program 2 [/app/project/2]],The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 6", "url" set to "Merge 1[Project 4 [/app/project/4], Project 2 [/app/project/2]],The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]" and "catrobatLanguageVersion" set to "0.993" When I upload this generated project, API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -1695,7 +1695,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Scratch parent having id "70058680", API version 2 And the uploaded project should have no further Scratch parents, API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "Merge 1[Program 4 [/app/project/4], Program 2 [/app/project/2]],The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]" in the xml, API version 2 + And the uploaded project should have RemixOf "Merge 1[Project 4 [/app/project/4], Project 2 [/app/project/2]],The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]" in the xml, API version 2 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -1793,10 +1793,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 6 with one less parent (program 3) should unlink all program 3's forward relations + Scenario: reuploading project 6 with one less parent (project 3) should unlink all project 3's forward relations since they have different depth level than the ones still needed #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -1813,7 +1813,7 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6", "url" set to "Program 4 [/app/project/4],The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]" and "catrobatLanguageVersion" set to "0.993" + Given I have a project with "name" set to "project 6", "url" set to "Project 4 [/app/project/4],The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]" and "catrobatLanguageVersion" set to "0.993" When I upload this generated project, API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -1827,7 +1827,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Scratch parent having id "70058680", API version 2 And the uploaded project should have no further Scratch parents, API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "Program 4 [/app/project/4],The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]" in the xml, API version 2 + And the uploaded project should have RemixOf "Project 4 [/app/project/4],The Colour Divide - Trailer[https://scratch.mit.edu/projects/70058680]" in the xml, API version 2 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -1919,11 +1919,11 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 6 with removed Scratch parent and with one less Catrobat parent (program 3) should - unlink Scratch parent relation and also unlink all program 3's forward relations since they have different + Scenario: reuploading project 6 with removed Scratch parent and with one less Catrobat parent (project 3) should + unlink Scratch parent relation and also unlink all project 3's forward relations since they have different depth level than the ones still needed #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) # \ / \ / @@ -1940,7 +1940,7 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6" and "url" set to "Program 4 [/app/project/4]" + Given I have a project with "name" set to "project 6" and "url" set to "Project 4 [/app/project/4]" When I upload this generated project, API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -1953,7 +1953,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat backward parents, API version 2 And the uploaded project should have no Scratch parents, API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "Program 4 [/app/project/4]" in the xml, API version 2 + And the uploaded project should have RemixOf "Project 4 [/app/project/4]" in the xml, API version 2 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -2045,10 +2045,10 @@ Feature: Upload a remixed program with multiple parents And the project "9" should have no Scratch parents And the project "9" should have no Catrobat forward descendants except self-relation - Scenario: reuploading program 6 with no parents any more should convert former backward relation (6 -> 4) + Scenario: reuploading project 6 with no parents any more should convert former backward relation (6 -> 4) to a forward ancestor relation #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) (6) (SCRATCH #2) # \ / \ / ______________/ @@ -2065,7 +2065,7 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6" and "url" set to "" + Given I have a project with "name" set to "project 6" and "url" set to "" When I upload this generated project, API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -2175,7 +2175,7 @@ Feature: Upload a remixed program with multiple parents Scenario: multiple consecutive reuploads (example #1) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) (6) (SCRATCH #2) # \ / \ / ______________/ @@ -2192,9 +2192,9 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6" and "url" set to "" + Given I have a project with "name" set to "project 6" and "url" set to "" When I upload this generated project, API version 2 - And I upload another project with name set to "program 4" and url set to "Program 2[/app/project/2]", API version 2 + And I upload another project with name set to "project 4" and url set to "Project 2[/app/project/2]", API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 And the uploaded project should have a Catrobat forward ancestor having id "4" and depth "0", API version 2 @@ -2205,7 +2205,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat backward parents, API version 2 And the uploaded project should have no Scratch parents, API version 2 And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 - And the uploaded project should have RemixOf "Program 2[/app/project/2]" in the xml, API version 2 + And the uploaded project should have RemixOf "Project 2[/app/project/2]" in the xml, API version 2 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -2302,7 +2302,7 @@ Feature: Upload a remixed program with multiple parents Scenario: multiple consecutive reuploads (example #2) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) (6) (SCRATCH #2) # \ / \ / ______________/ @@ -2319,9 +2319,9 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6" and "url" set to "" + Given I have a project with "name" set to "project 6" and "url" set to "" When I upload this generated project, API version 2 - And I upload another project with name set to "program 4" and url set to "", API version 2 + And I upload another project with name set to "project 4" and url set to "", API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 And the uploaded project should have a Catrobat forward ancestor having id "4" and depth "0", API version 2 @@ -2423,7 +2423,7 @@ Feature: Upload a remixed program with multiple parents Scenario: multiple consecutive reuploads (example #3) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) (1) (SCRATCH #1) (SCRATCH #2) # \ / \ / @@ -2440,10 +2440,10 @@ Feature: Upload a remixed program with multiple parents # (not drawn in this graph). #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 6" and "url" set to "" + Given I have a project with "name" set to "project 6" and "url" set to "" When I upload this generated project, API version 2 - And I upload another project with name set to "program 2", url set to "Program 1[/app/project/1],Music Inventor [https://scratch.mit.edu/projects/29495624]" and catrobatLanguageVersion set to "0.993", API version 2 - And I upload another project with name set to "program 4" and url set to "Program 2[/app/project/2]", API version 2 + And I upload another project with name set to "project 2", url set to "Project 1[/app/project/1],Music Inventor [https://scratch.mit.edu/projects/29495624]" and catrobatLanguageVersion set to "0.993", API version 2 + And I upload another project with name set to "project 4" and url set to "Project 2[/app/project/2]", API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 And the uploaded project should have a Catrobat forward ancestor having id "4" and depth "0", API version 2 @@ -2453,7 +2453,7 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat backward parents, API version 2 And the uploaded project should have no Scratch parents, API version 2 And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 - And the uploaded project should have RemixOf "Program 2[/app/project/2]" in the xml, API version 2 + And the uploaded project should have RemixOf "Project 2[/app/project/2]" in the xml, API version 2 And the project "1" should be a remix root And the project "1" should have a Catrobat forward ancestor having id "1" and depth "0" @@ -2479,7 +2479,7 @@ Feature: Upload a remixed program with multiple parents And the project "2" should have a Catrobat forward descendant having id "5" and depth "2" And the project "2" should have a Catrobat forward descendant having id "7" and depth "3" And the project "2" should have no further Catrobat forward descendants - And the project "2" should have RemixOf "Program 1[/app/project/1],Music Inventor [https://scratch.mit.edu/projects/29495624]" in the xml + And the project "2" should have RemixOf "Project 1[/app/project/1],Music Inventor [https://scratch.mit.edu/projects/29495624]" in the xml And the project "3" should not be a remix root And the project "3" should have a Catrobat forward ancestor having id "3" and depth "0" diff --git a/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_uuid.feature b/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_uuid.feature index 787937e350..709c6eea53 100644 --- a/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_uuid.feature +++ b/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_uuid.feature @@ -1,5 +1,5 @@ @api @projects @post @remixes -Feature: Upload a remixed program with multiple parents should also work with the new UUIDs +Feature: Upload a remixed project with multiple parents should also work with the new UUIDs Background: Given there are users: @@ -8,13 +8,13 @@ Feature: Upload a remixed program with multiple parents should also work with th And there are projects: | id | name | description | owned by | downloads | views | upload time | version | remix_root | - | 390a46b7-4dca-11ea-b467-08002765cf2c | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | - | 38389632-4dca-11ea-b467-08002765cf2c | program 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | true | - | 35d70287-4dca-11ea-b467-08002765cf2c | program 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | true | - | 379dc210-4dca-11ea-b467-08002765cf2c | program 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | false | - | 110a46b7-4dca-11ea-b467-08002765cf2c | program 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | - | 220a46b7-4dca-11ea-b467-08002765cf2c | program 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 330a46b7-4dca-11ea-b467-08002765cf2c | program 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 390a46b7-4dca-11ea-b467-08002765cf2c | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | + | 38389632-4dca-11ea-b467-08002765cf2c | project 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | true | + | 35d70287-4dca-11ea-b467-08002765cf2c | project 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | true | + | 379dc210-4dca-11ea-b467-08002765cf2c | project 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | false | + | 110a46b7-4dca-11ea-b467-08002765cf2c | project 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | + | 220a46b7-4dca-11ea-b467-08002765cf2c | project 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 330a46b7-4dca-11ea-b467-08002765cf2c | project 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | #------------------------------------------------------------------------------------------------------------------- # this is how the remix graph looks like according to the following forward remix relations (closure table): @@ -58,9 +58,9 @@ Feature: Upload a remixed program with multiple parents should also work with th | 29495624 | 110a46b7-4dca-11ea-b467-08002765cf2c | | 29495624 | 330a46b7-4dca-11ea-b467-08002765cf2c | - Scenario: reuploading program 4 with only one parent unlinks former parent + Scenario: reuploading project 4 with only one parent unlinks former parent #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (2) (3) (Scratch) (1) (2) (3) (Scratch) # \ / / / \ / / @@ -72,7 +72,7 @@ Feature: Upload a remixed program with multiple parents should also work with th # #------------------------------------------------------------------------------------------------------------------- Given I am "Catrobat" - Given I have a project with "name" set to "program 4" and "url" set to "program 390a46b7-4dca-11ea-b467-08002765cf2c[/pocketalice/project/390a46b7-4dca-11ea-b467-08002765cf2c]" + Given I have a project with "name" set to "project 4" and "url" set to "project 390a46b7-4dca-11ea-b467-08002765cf2c[/pocketalice/project/390a46b7-4dca-11ea-b467-08002765cf2c]" When I upload this generated project, API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -84,7 +84,7 @@ Feature: Upload a remixed program with multiple parents should also work with th And the uploaded project should have a Catrobat forward descendant having id "220a46b7-4dca-11ea-b467-08002765cf2c" and depth "1", API version 2 And the uploaded project should have a Catrobat forward descendant having id "330a46b7-4dca-11ea-b467-08002765cf2c" and depth "2", API version 2 And the uploaded project should have no further Catrobat forward descendants, API version 2 - And the uploaded project should have RemixOf "program 390a46b7-4dca-11ea-b467-08002765cf2c[/pocketalice/project/390a46b7-4dca-11ea-b467-08002765cf2c]" in the xml, API version 2 + And the uploaded project should have RemixOf "project 390a46b7-4dca-11ea-b467-08002765cf2c[/pocketalice/project/390a46b7-4dca-11ea-b467-08002765cf2c]" in the xml, API version 2 And the project "390a46b7-4dca-11ea-b467-08002765cf2c" should be a remix root And the project "390a46b7-4dca-11ea-b467-08002765cf2c" should have a Catrobat forward ancestor having id "390a46b7-4dca-11ea-b467-08002765cf2c" and depth "0" diff --git a/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_with_more_parents.feature b/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_with_more_parents.feature index 0b48d0305a..3d1a1c2cc2 100644 --- a/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_with_more_parents.feature +++ b/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_with_more_parents.feature @@ -1,5 +1,5 @@ @api @projects @post @remixes -Feature: Upload a remixed program with multiple parents +Feature: Upload a remixed project with multiple parents Background: Given there are users: @@ -8,15 +8,15 @@ Feature: Upload a remixed program with multiple parents And there are projects: | id | name | description | owned by | downloads | views | upload time | version | remix_root | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | - | 2 | program 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | - | 3 | program 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 4 | program 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | false | - | 5 | program 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | - | 6 | program 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 7 | program 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 8 | program 8 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 9 | program 9 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | + | 2 | project 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | + | 3 | project 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 4 | project 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | false | + | 5 | project 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | + | 6 | project 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 7 | project 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 8 | project 8 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 9 | project 9 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | #------------------------------------------------------------------------------------------------------------------- # this is how the remix graph looks like according to the following forward remix relations (closure table): @@ -65,9 +65,9 @@ Feature: Upload a remixed program with multiple parents | 8 | 9 | 1 | | 9 | 9 | 0 | - Scenario: program upload with parent-URL referring to no existing Catrobat programs should not add any remix relations + Scenario: project upload with parent-URL referring to no existing Catrobat projects should not add any remix relations (except self referencing relation) - Given I have a project with "catrobatLanguageVersion" set to "0.993" and "url" set to "Program 10 [/app/project/10], Program 11 [https://share.catrob.at/app/project/11]" + Given I have a project with "catrobatLanguageVersion" set to "0.993" and "url" set to "Project 10 [/app/project/10], Project 11 [https://share.catrob.at/app/project/11]" When I upload the project with the id "10", API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -75,11 +75,11 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat ancestors except self-relation, API version 2 And the uploaded project should have no Scratch parents, API version 2 And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 - And the uploaded project should have RemixOf "Program 10 [/app/project/10], Program 11 [https://share.catrob.at/app/project/11]" in the xml, API version 2 + And the uploaded project should have RemixOf "Project 10 [/app/project/10], Project 11 [https://share.catrob.at/app/project/11]" in the xml, API version 2 - Scenario: program upload with parent-URL referring to multiple existing Catrobat root programs + Scenario: project upload with parent-URL referring to multiple existing Catrobat root projects but Catrobat language version 0.992 should not add any remix relations (except self referencing relation) - Given I have a project with "catrobatLanguageVersion" set to "0.992" and "url" set to "Program 1 [/app/project/1], Program 8 [https://share.catrob.at/app/project/8]" + Given I have a project with "catrobatLanguageVersion" set to "0.992" and "url" set to "Project 1 [/app/project/1], Project 8 [https://share.catrob.at/app/project/8]" When I upload the project with the id "10", API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -89,9 +89,9 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 And the uploaded project should have RemixOf "" in the xml, API version 2 - Scenario: program upload with parent-URL referring to multiple existing Catrobat root programs + Scenario: project upload with parent-URL referring to multiple existing Catrobat root projects but Catrobat language version 0.991 should not add any remix relations (except self referencing relation) - Given I have a project with "catrobatLanguageVersion" set to "0.991" and "url" set to "Program 1 [/app/project/1], Program 8 [https://share.catrob.at/app/project/8]" + Given I have a project with "catrobatLanguageVersion" set to "0.991" and "url" set to "Project 1 [/app/project/1], Project 8 [https://share.catrob.at/app/project/8]" When I upload the project with the id "10", API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -101,9 +101,9 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 And the uploaded project should have RemixOf "" in the xml, API version 2 - Scenario: program upload with parent-URL referring to multiple existing Catrobat root programs + Scenario: project upload with parent-URL referring to multiple existing Catrobat root projects but Catrobat language version 0.99 should not add any remix relations (except self referencing relation) - Given I have a project with "catrobatLanguageVersion" set to "0.99" and "url" set to "Program 1 [/app/project/1], Program 8 [https://share.catrob.at/app/project/8]" + Given I have a project with "catrobatLanguageVersion" set to "0.99" and "url" set to "Project 1 [/app/project/1], Project 8 [https://share.catrob.at/app/project/8]" When I upload the project with the id "10", API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -113,9 +113,9 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 And the uploaded project should have RemixOf "" in the xml, API version 2 - Scenario: program upload with parent-URL referring to multiple existing Catrobat root programs + Scenario: project upload with parent-URL referring to multiple existing Catrobat root projects but Catrobat language version 0.92 should not add any remix relations (except self referencing relation) - Given I have a project with "catrobatLanguageVersion" set to "0.92" and "url" set to "Program 1 [/app/project/1], Program 8 [https://share.catrob.at/app/project/8]" + Given I have a project with "catrobatLanguageVersion" set to "0.92" and "url" set to "Project 1 [/app/project/1], Project 8 [https://share.catrob.at/app/project/8]" When I upload the project with the id "10", API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -125,13 +125,13 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 And the uploaded project should have RemixOf "" in the xml, API version 2 - Scenario: program upload with parent-URL referring to existing Catrobat root programs and + Scenario: project upload with parent-URL referring to existing Catrobat root projects and Catrobat language version 0.993 should correctly add remix relations #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # (1)______________ (8) # \ \ / \ - # (2)_____ (10) (9) <-- to be added (uploaded program will get ID "10") + # (2)_____ (10) (9) <-- to be added (uploaded project will get ID "10") # / \ \ # (3) (4) | # | \ | | @@ -139,7 +139,7 @@ Feature: Upload a remixed program with multiple parents # \ / # (7) #------------------------------------------------------------------------------------------------------------------- - Given I have a project with "catrobatLanguageVersion" set to "0.993" and "url" set to "Program 1 [/app/project/1], Program 8 [https://share.catrob.at/app/project/8]" + Given I have a project with "catrobatLanguageVersion" set to "0.993" and "url" set to "Project 1 [/app/project/1], Project 8 [https://share.catrob.at/app/project/8]" When I upload the project with the id "10", API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -150,17 +150,17 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat backward parents, API version 2 And the uploaded project should have no Scratch parents, API version 2 And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 - And the uploaded project should have RemixOf "Program 1 [/app/project/1], Program 8 [https://share.catrob.at/app/project/8]" in the xml, API version 2 + And the uploaded project should have RemixOf "Project 1 [/app/project/1], Project 8 [https://share.catrob.at/app/project/8]" in the xml, API version 2 - Scenario: program upload with parent-URL referring only to Scratch programs and + Scenario: project upload with parent-URL referring only to Scratch projects and Catrobat language version 0.999 should correctly add remix relations #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (SCRATCH #1) (SCRATCH #2) # \ / # \ / - # (10) <-- to be added (uploaded program will get ID "10") + # (10) <-- to be added (uploaded project will get ID "10") # #------------------------------------------------------------------------------------------------------------------- Given I have a project with "catrobatLanguageVersion" set to "0.999" and "url" set to "Music Inventor [https://scratch.mit.edu/projects/29495624], The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/]" @@ -175,10 +175,10 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 And the uploaded project should have RemixOf "Music Inventor [https://scratch.mit.edu/projects/29495624], The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/]" in the xml, API version 2 - Scenario: program upload with parent-URL referring to existing Catrobat programs and + Scenario: project upload with parent-URL referring to existing Catrobat projects and Catrobat language version 1 should correctly add remix relations (example #1) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) # \ @@ -190,10 +190,10 @@ Feature: Upload a remixed program with multiple parents # \ / | | # (7) | (9) # | | | - # (10)____/____________/ <-- to be added (uploaded program will get ID "10") + # (10)____/____________/ <-- to be added (uploaded project will get ID "10") # #------------------------------------------------------------------------------------------------------------------- - Given I have a project with "catrobatLanguageVersion" set to "1" and "url" set to "Program 2 [/pocketalice/project/2], Merge 1 [Program 7 [/app/project/7], Program 9 [https://share.catrob.at/app/project/9]]" + Given I have a project with "catrobatLanguageVersion" set to "1" and "url" set to "Project 2 [/pocketalice/project/2], Merge 1 [Project 7 [/app/project/7], Project 9 [https://share.catrob.at/app/project/9]]" When I upload the project with the id "10", API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -215,9 +215,9 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have no Catrobat backward parents, API version 2 And the uploaded project should have no Scratch parents, API version 2 And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 - And the uploaded project should have RemixOf "Program 2 [/pocketalice/project/2], Merge 1 [Program 7 [/app/project/7], Program 9 [https://share.catrob.at/app/project/9]]" in the xml, API version 2 + And the uploaded project should have RemixOf "Project 2 [/pocketalice/project/2], Merge 1 [Project 7 [/app/project/7], Project 9 [https://share.catrob.at/app/project/9]]" in the xml, API version 2 - Scenario: program upload with parent-URL referring to existing Catrobat programs and + Scenario: project upload with parent-URL referring to existing Catrobat projects and Catrobat language version 1.0 should correctly add remix relations (example #2) Given there are Scratch remix relations: | scratch_parent_id | catrobat_child_id | @@ -231,7 +231,7 @@ Feature: Upload a remixed program with multiple parents | 6 | 1 | #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) # \ / @@ -241,12 +241,12 @@ Feature: Upload a remixed program with multiple parents # | \ | | (8) # (5) (6)__/|_____/ \ # \ / \ / (9) - # (7) (10) <-- to be added (uploaded program will get ID "10") + # (7) (10) <-- to be added (uploaded project will get ID "10") # # Note: there are some additional remix backward relations (see table above) not shown in the graph for clarity reasons. - # This test will also check that no backward parents of parent program will be linked to the uploaded program. + # This test will also check that no backward parents of parent project will be linked to the uploaded project. #------------------------------------------------------------------------------------------------------------------- - Given I have a project with "catrobatLanguageVersion" set to "1.0" and "url" set to "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Program 2 [/pocketalice/project/2], Merge 1 [Program 6 [/app/project/6], Program 8 [https://share.catrob.at/app/project/8]]]" + Given I have a project with "catrobatLanguageVersion" set to "1.0" and "url" set to "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Project 2 [/pocketalice/project/2], Merge 1 [Project 6 [/app/project/6], Project 8 [https://share.catrob.at/app/project/8]]]" When I upload the project with the id "10", API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -266,9 +266,9 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Scratch parent having id "70058680", API version 2 And the uploaded project should have no further Scratch parents, API version 2 And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 - And the uploaded project should have RemixOf "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Program 2 [/pocketalice/project/2], Merge 1 [Program 6 [/app/project/6], Program 8 [https://share.catrob.at/app/project/8]]]" in the xml, API version 2 + And the uploaded project should have RemixOf "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Project 2 [/pocketalice/project/2], Merge 1 [Project 6 [/app/project/6], Project 8 [https://share.catrob.at/app/project/8]]]" in the xml, API version 2 - Scenario: program upload with parent-URL referring to existing Catrobat programs and + Scenario: project upload with parent-URL referring to existing Catrobat projects and Catrobat language version 1.1 should correctly add remix relations (example #2) Given there are Scratch remix relations: | scratch_parent_id | catrobat_child_id | @@ -282,7 +282,7 @@ Feature: Upload a remixed program with multiple parents | 6 | 1 | #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (1) (SCRATCH #1) # \ / @@ -292,12 +292,12 @@ Feature: Upload a remixed program with multiple parents # | \ | | (8) # (5) (6)__/|_____/ \ # \ / \ / (9) - # (7) (10) <-- to be added (uploaded program will get ID "10") + # (7) (10) <-- to be added (uploaded project will get ID "10") # # Note: there are some additional remix backward relations (see table above) not shown in the graph for clarity reasons. - # This test will also check that no backward parents of parent program will be linked to the uploaded program. + # This test will also check that no backward parents of parent project will be linked to the uploaded project. #------------------------------------------------------------------------------------------------------------------- - Given I have a project with "catrobatLanguageVersion" set to "1.1" and "url" set to "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Program 2 [/pocketalice/project/2], Merge 1 [Program 6 [/app/project/6], Program 8 [https://share.catrob.at/app/project/8]]]" + Given I have a project with "catrobatLanguageVersion" set to "1.1" and "url" set to "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Project 2 [/pocketalice/project/2], Merge 1 [Project 6 [/app/project/6], Project 8 [https://share.catrob.at/app/project/8]]]" When I upload the project with the id "10", API version 2 Then the uploaded project should not be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -317,4 +317,4 @@ Feature: Upload a remixed program with multiple parents And the uploaded project should have a Scratch parent having id "70058680", API version 2 And the uploaded project should have no further Scratch parents, API version 2 And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 - And the uploaded project should have RemixOf "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Program 2 [/pocketalice/project/2], Merge 1 [Program 6 [/app/project/6], Program 8 [https://share.catrob.at/app/project/8]]]" in the xml, API version 2 + And the uploaded project should have RemixOf "The Colour Divide - Trailer [https://scratch.mit.edu/projects/70058680/], Merge 2 [Project 2 [/pocketalice/project/2], Merge 1 [Project 6 [/app/project/6], Project 8 [https://share.catrob.at/app/project/8]]]" in the xml, API version 2 diff --git a/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_with_one_parent.feature b/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_with_one_parent.feature index db5c33cd9d..b76f8d6e7d 100644 --- a/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_with_one_parent.feature +++ b/tests/BehatFeatures/api/projects/POST_projects/projects_post_remix_with_one_parent.feature @@ -1,5 +1,5 @@ @api @projects @post @remixes -Feature: Upload a remixed program with one parent +Feature: Upload a remixed project with one parent Background: Given there are users: @@ -8,15 +8,15 @@ Feature: Upload a remixed program with one parent And there are projects: | id | name | description | owned by | downloads | views | upload time | version | remix_root | - | 1 | program 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | - | 2 | program 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | - | 3 | program 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 4 | program 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | - | 5 | program 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | - | 6 | program 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 7 | program 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 8 | program 8 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | - | 9 | program 9 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 1 | project 1 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | + | 2 | project 2 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | + | 3 | project 3 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 4 | project 4 | p1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.8.5 | true | + | 5 | project 5 | | Catrobat | 33 | 9 | 01.02.2013 13:00 | 0.8.5 | false | + | 6 | project 6 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 7 | project 7 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 8 | project 8 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | + | 9 | project 9 | | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.8.5 | false | #------------------------------------------------------------------------------------------------------------------- # this is how the remix graph looks like according to the following forward remix relations (closure table): @@ -35,7 +35,7 @@ Feature: Upload a remixed program with one parent | 2 | 3 | 1 | | 3 | 3 | 0 | - Scenario: program upload with no parent-URL should not add any remix relations (except self referencing relation) + Scenario: project upload with no parent-URL should not add any remix relations (except self referencing relation) Given I have a project with "url" set to "" When I upload the project with the id "10", API version 2 Then the uploaded project should be a remix root, API version 2 @@ -46,8 +46,8 @@ Feature: Upload a remixed program with one parent And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 And the uploaded project should have RemixOf "" in the xml, API version 2 - Scenario: program upload with local program name parent-URL should not add any remix relations (except self referencing relation) - Given I have a project with "url" set to "My first program" + Scenario: project upload with local project name parent-URL should not add any remix relations (except self referencing relation) + Given I have a project with "url" set to "My first project" When I upload the project with the id "10", API version 2 Then the uploaded project should be a remix root, API version 2 And the uploaded project should have remix migration date NOT NULL, API version 2 @@ -55,9 +55,9 @@ Feature: Upload a remixed program with one parent And the uploaded project should have no Catrobat ancestors except self-relation, API version 2 And the uploaded project should have no Scratch parents, API version 2 And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 - And the uploaded project should have RemixOf "My first program" in the xml, API version 2 + And the uploaded project should have RemixOf "My first project" in the xml, API version 2 - Scenario: program upload with invalid parent-URL should not add any remix relations (except self referencing relation) + Scenario: project upload with invalid parent-URL should not add any remix relations (except self referencing relation) Given I have a project with "url" set to "https://www.google.com" When I upload the project with the id "10", API version 2 Then the uploaded project should be a remix root, API version 2 @@ -68,7 +68,7 @@ Feature: Upload a remixed program with one parent And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 And the uploaded project should have RemixOf "https://www.google.com" in the xml, API version 2 - Scenario: program upload with parent-URL referring to own Catrobat program should not add any remix relations + Scenario: project upload with parent-URL referring to own Catrobat project should not add any remix relations (except self referencing relation) Given I have a project with "url" set to "/app/project/10" When I upload the project with the id "10", API version 2 @@ -80,7 +80,7 @@ Feature: Upload a remixed program with one parent And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 And the uploaded project should have RemixOf "/app/project/10" in the xml, API version 2 - Scenario: program upload with parent-URL referring to no existing Catrobat program should not add any remix relations + Scenario: project upload with parent-URL referring to no existing Catrobat project should not add any remix relations (except self referencing relation) Given I have a project with "url" set to "/app/project/11" When I upload the project with the id "10", API version 2 @@ -92,13 +92,13 @@ Feature: Upload a remixed program with one parent And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 And the uploaded project should have RemixOf "/app/project/11" in the xml, API version 2 - Scenario: program upload with parent-URL referring to existing Catrobat non-root program + Scenario: project upload with parent-URL referring to existing Catrobat non-root project should correctly add remix relations (example #1) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # (1) # / \ - # (2) (10) <-- to be added (uploaded program will get ID "10") + # (2) (10) <-- to be added (uploaded project will get ID "10") # | # (3) #------------------------------------------------------------------------------------------------------------------- @@ -114,15 +114,15 @@ Feature: Upload a remixed program with one parent And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 And the uploaded project should have RemixOf "/app/project/1" in the xml, API version 2 - Scenario: program upload with parent-URL referring to existing Catrobat non-root program + Scenario: project upload with parent-URL referring to existing Catrobat non-root project should correctly add remix relations (example #2) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # (1) # | # (2) # / \ - # (3) (10) <-- to be added (uploaded program will get ID "10") + # (3) (10) <-- to be added (uploaded project will get ID "10") #------------------------------------------------------------------------------------------------------------------- Given I have a project with "url" set to "/pocketalice/project/2" When I upload the project with the id "10", API version 2 @@ -136,17 +136,17 @@ Feature: Upload a remixed program with one parent And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 And the uploaded project should have RemixOf "/pocketalice/project/2" in the xml, API version 2 - Scenario: program upload with parent-URL referring to existing Catrobat non-root program + Scenario: project upload with parent-URL referring to existing Catrobat non-root project should correctly add remix relations (example #3) #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # (1) # \ # (2) # / # (3) # \ - # (10) <-- to be added (uploaded program will get ID "10") + # (10) <-- to be added (uploaded project will get ID "10") #------------------------------------------------------------------------------------------------------------------- Given I have a project with "url" set to "/pocketalice/project/3" When I upload the project with the id "10", API version 2 @@ -162,13 +162,13 @@ Feature: Upload a remixed program with one parent And the uploaded project should have no Catrobat forward descendants except self-relation, API version 2 And the uploaded project should have RemixOf "/pocketalice/project/3" in the xml, API version 2 - Scenario: program upload with parent-URL referring to Scratch program should correctly add remix relations + Scenario: project upload with parent-URL referring to Scratch project should correctly add remix relations #------------------------------------------------------------------------------------------------------------------- - # this is how the remix graph should look like after the program is uploaded: + # this is how the remix graph should look like after the project is uploaded: # # (Scratch #70058680) # | - # (10) <-- to be added (uploaded program will get ID "10") + # (10) <-- to be added (uploaded project will get ID "10") # #------------------------------------------------------------------------------------------------------------------- Given I have a project with "url" set to "https://scratch.mit.edu/projects/70058680" @@ -196,7 +196,7 @@ Feature: Upload a remixed program with one parent # | \ / | # \______ (9) _______/ # | - # (10) <-- to be added (uploaded program will get ID "10") + # (10) <-- to be added (uploaded project will get ID "10") # #------------------------------------------------------------------------------------------------------------------- Given there are forward remix relations: @@ -256,7 +256,7 @@ Feature: Upload a remixed program with one parent # \ / | \ | # (5) / (7) | # / \ /__/ | | - # to be added (uploaded program will get ID "10") --> (10) \ / | | + # to be added (uploaded project will get ID "10") --> (10) \ / | | # (6) (8)____/ # \ / # (9) @@ -311,15 +311,15 @@ Feature: Upload a remixed program with one parent # \ / | \ | # (5) / (7) | # \ /__/ | \ | - # \ / | (10) | <-- to be added (uploaded program will get ID "10") + # \ / | (10) | <-- to be added (uploaded project will get ID "10") # (6) (8)____/ # \ / # (9) # - # Note: unlike the previous example there is an additional remix backward relation from program #9 to - # the program #7, in this example. But this is not drawn in the graph above for clarity reasons. - # Since program #7 will be the parent of the uploaded program #10, this test will also check that no ancestors - # of program #9 (including itself) are linked to the uploaded program. + # Note: unlike the previous example there is an additional remix backward relation from project #9 to + # the project #7, in this example. But this is not drawn in the graph above for clarity reasons. + # Since project #7 will be the parent of the uploaded project #10, this test will also check that no ancestors + # of project #9 (including itself) are linked to the uploaded project. #------------------------------------------------------------------------------------------------------------------- Given there are forward remix relations: | ancestor_id | descendant_id | depth | diff --git a/tests/BehatFeatures/api/projects/POST_projects/projects_post_sanitization.feature b/tests/BehatFeatures/api/projects/POST_projects/projects_post_sanitization.feature index 9e38e08dfe..c131b72242 100644 --- a/tests/BehatFeatures/api/projects/POST_projects/projects_post_sanitization.feature +++ b/tests/BehatFeatures/api/projects/POST_projects/projects_post_sanitization.feature @@ -1,12 +1,12 @@ @api @projects @post Feature: After uploading unnecessary files should be removed - Scenario: Program Sanitizer should remove unnecessary files + Scenario: Project Sanitizer should remove unnecessary files Given I try to upload a project with unnecessary files, API version 2 Then the uploaded project should exist in the database, API version 2 And the resources should not contain the unnecessary files - Scenario: Program Sanitizer should remove unnecessary files even when scenes are used + Scenario: Project Sanitizer should remove unnecessary files even when scenes are used Given I try to upload a project with scenes and unnecessary files, API version 2 Then the uploaded project should exist in the database, API version 2 And the resources should not contain the unnecessary files diff --git a/tests/BehatFeatures/api/projects/POST_projects/projects_post_tags.feature b/tests/BehatFeatures/api/projects/POST_projects/projects_post_tags.feature index cced07a3b0..46aaa33f61 100644 --- a/tests/BehatFeatures/api/projects/POST_projects/projects_post_tags.feature +++ b/tests/BehatFeatures/api/projects/POST_projects/projects_post_tags.feature @@ -12,31 +12,31 @@ Feature: Upload a project with tag | 3 | Music | Musik | | 4 | Art | Kunst | - Scenario: upload a tagged program with tags Games and Story + Scenario: upload a tagged project with tags Games and Story Given I have a project with "tags" set to "Games,Story" And I use the "english" app, API version 2 When I upload this generated project, API version 2 Then the project should be tagged with "Games,Story" in the database - Scenario: upload a tagged program with tags Music and Art on a device with no supported language + Scenario: upload a tagged project with tags Music and Art on a device with no supported language Given I have a project with "tags" set to "Music,Art" And I use the "unknownLanguage" app, API version 2 When I upload this generated project, API version 2 Then the project should be tagged with "Music,Art" in the database - Scenario: upload a tagged program with unknown tags + Scenario: upload a tagged project with unknown tags Given I have a project with "tags" set to "Huhu,dontKnow" And I use the "english" app, API version 2 When I upload this generated project, API version 2 Then the project should not be tagged - Scenario: upload a tagged program with more then three tags + Scenario: upload a tagged project with more then three tags Given I have a project with "tags" set to "Games,Story,Music,Art" And I use the "english" app, API version 2 When I upload this generated project, API version 2 Then the project should be tagged with "Games,Story,Music" in the database - Scenario: update a program with other tags + Scenario: update a project with other tags Given I have a project with "tags" set to "Music,Art" And I use the "english" app, API version 2 And I upload this generated project, API version 2 diff --git a/tests/BehatFeatures/api/projects/POST_projects/projects_post_validation.feature b/tests/BehatFeatures/api/projects/POST_projects/projects_post_validation.feature index 9ce9926093..14694312da 100644 --- a/tests/BehatFeatures/api/projects/POST_projects/projects_post_validation.feature +++ b/tests/BehatFeatures/api/projects/POST_projects/projects_post_validation.feature @@ -1,10 +1,10 @@ @api @projects @post -Feature: All uploaded programs have to be validated. +Feature: All uploaded projects have to be validated. Background: Given I am a valid user - Scenario: program must have a code.xml + Scenario: project must have a code.xml When I upload a project with "a missing code.xml", API version 2 Then the response status code should be "422" And I should get the json object: @@ -14,7 +14,7 @@ Feature: All uploaded programs have to be validated. } """ - Scenario: program must have a valid code.xml + Scenario: project must have a valid code.xml When I upload a project with "an invalid code.xml", API version 2 Then the response status code should be "422" And I should get the json object: @@ -25,7 +25,7 @@ Feature: All uploaded programs have to be validated. """ @disabled - Scenario: program with missing images are rejected + Scenario: project with missing images are rejected When I upload a project with "a missing image", API version 2 Then the response status code should be "422" And I should get the json object: @@ -36,7 +36,7 @@ Feature: All uploaded programs have to be validated. """ @disabled - Scenario: program with media files not defined in xml are rejected + Scenario: project with media files not defined in xml are rejected When I upload a project with "an additional image", API version 2 Then the response status code should be "422" And I should get the json object: @@ -46,7 +46,7 @@ Feature: All uploaded programs have to be validated. } """ - Scenario: invalid catrobat program files should be rejected + Scenario: invalid catrobat project files should be rejected When I upload an invalid project file, API version 2 Then the response status code should be "422" And I should get the json object: @@ -56,7 +56,7 @@ Feature: All uploaded programs have to be validated. } """ - Scenario Outline: user should not be able to upload a program with an old pocketcode version + Scenario Outline: user should not be able to upload a project with an old pocketcode version Given I am using pocketcode for "" with version "" When I upload a generated project, API version 2 Then the response status code should be "422" @@ -74,7 +74,7 @@ Feature: All uploaded programs have to be validated. | iOS | 0.0.1 | - Scenario Outline: user should not be able to upload a program with an old pocketcode version + Scenario Outline: user should not be able to upload a project with an old pocketcode version Given I am using pocketcode for "" with version "" When I upload a generated project, API version 2 Then the uploaded project should exist in the database, API version 2 @@ -87,7 +87,7 @@ Feature: All uploaded programs have to be validated. | iOS | 0.1.0 | - Scenario: user should not be able to upload a program with an old language version + Scenario: user should not be able to upload a project with an old language version Given I am using pocketcode with language version "0.7" When I upload a generated project, API version 2 Then the response status code should be "422" diff --git a/tests/BehatFeatures/api/tag/get_tag.feature b/tests/BehatFeatures/api/tag/get_tag.feature index 5afecae8c5..07ab998540 100644 --- a/tests/BehatFeatures/api/tag/get_tag.feature +++ b/tests/BehatFeatures/api/tag/get_tag.feature @@ -1,5 +1,5 @@ @api @tag -Feature: Upload a program with tag (Attention still the deprecated API!) +Feature: Upload a project with tag (Attention still the deprecated API!) Background: And I run the update tags command diff --git a/tests/BehatFeatures/web/admin/apk_generation_pending.feature b/tests/BehatFeatures/web/admin/apk_generation_pending.feature index 6c5ac94346..577ec7476d 100644 --- a/tests/BehatFeatures/web/admin/apk_generation_pending.feature +++ b/tests/BehatFeatures/web/admin/apk_generation_pending.feature @@ -12,10 +12,10 @@ Feature: APK-Generation Pending in Admin Area | Gregor | 123456 | dddddddddd | dev2@pocketcode.org | 3 | And there are projects: | id | name | description | owned by | apk request time | apk_status | - | 1 | program 1 | ready program | Superman | | ready | - | 2 | program 2 | none program | Gregor | | none | - | 3 | program 3 | pending program 1 | Admin | 27.05.2020 10:00 | pending | - | 4 | program 4 | pending program 2 | Admin | 27.05.2020 11:00 | pending | + | 1 | project 1 | ready project | Superman | | ready | + | 2 | project 2 | none project | Gregor | | none | + | 3 | project 3 | pending project 1 | Admin | 27.05.2020 10:00 | pending | + | 4 | project 4 | pending project 2 | Admin | 27.05.2020 11:00 | pending | Scenario: List should be complete and sorted after Apk Request Time DESC Given I log in as "Admin" with the password "123456" @@ -23,8 +23,8 @@ Feature: APK-Generation Pending in Admin Area And I wait for the page to be loaded Then I should see the pending apk table: | Id | User | Name | Apk Request Time | Apk Status | - | 3 | Admin | program 3 | | pending | - | 4 | Admin | program 4 | | pending | + | 3 | Admin | project 3 | | pending | + | 4 | Admin | project 4 | | pending | Scenario: The rebuild button should rebuild apk and set state to pending Given I log in as "Admin" with the password "123456" @@ -34,8 +34,8 @@ Feature: APK-Generation Pending in Admin Area And I wait for the page to be loaded And I should see the pending apk table: | Id | User | Name | Apk Request Time | Apk Status | - | 3 | Admin | program 3 | | pending | - | 4 | Admin | program 4 | | pending | + | 3 | Admin | project 3 | | pending | + | 4 | Admin | project 4 | | pending | Scenario: The reset button should reset the apk status and the request time Given I log in as "Admin" with the password "123456" @@ -45,18 +45,18 @@ Feature: APK-Generation Pending in Admin Area And I wait for the page to be loaded And I am on "/admin/apk_pending/list" And I wait for the page to be loaded - And I should not see "program 3" + And I should not see "project 3" - Scenario: The reset all button should reset all programs + Scenario: The reset all button should reset all projects Given I log in as "Admin" with the password "123456" And I am on "/admin/apk_pending/list" And I wait for the page to be loaded Then I am on "/admin/apk_pending/resetPendingProjects" And I wait for the page to be loaded - And I should not see "program 3" - And I should not see "program 4" + And I should not see "project 3" + And I should not see "project 4" - Scenario: The rebuild all button should rebuild all programs + Scenario: The rebuild all button should rebuild all projects Given I log in as "Admin" with the password "123456" And I am on "/admin/apk_pending/list" And I wait for the page to be loaded @@ -64,7 +64,7 @@ Feature: APK-Generation Pending in Admin Area And I wait for the page to be loaded And I should see the pending apk table: | Id | User | Name | Apk Request Time | Apk Status | - | 3 | Admin | program 3 | | pending | - | 4 | Admin | program 4 | | pending | + | 3 | Admin | project 3 | | pending | + | 4 | Admin | project 4 | | pending | And I should not see "May 27, 2020 10:00" And I should not see "May 27, 2020 11:00" diff --git a/tests/BehatFeatures/web/admin/apk_generation_ready.feature b/tests/BehatFeatures/web/admin/apk_generation_ready.feature index e34926872d..d5bf0bbc8c 100644 --- a/tests/BehatFeatures/web/admin/apk_generation_ready.feature +++ b/tests/BehatFeatures/web/admin/apk_generation_ready.feature @@ -12,9 +12,9 @@ Feature: APK-Generation Pending in Admin Area | Gregor | 123456 | dddddddddd | dev2@pocketcode.org | 3 | And there are projects: | id | name | description | owned by | apk request time | apk_status | - | 1 | program 1 | my superman description | Superman | 02.06.2020 10:00 | ready | - | 2 | program 2 | abcef | Gregor | 02.06.2020 11:00 | ready | - | 3 | program 3 | hello | Admin | 02.06.2020 08:00 | ready | + | 1 | project 1 | my superman description | Superman | 02.06.2020 10:00 | ready | + | 2 | project 2 | abcef | Gregor | 02.06.2020 11:00 | ready | + | 3 | project 3 | hello | Admin | 02.06.2020 08:00 | ready | Scenario: List should be complete and sorted after Apk Request Time DESC Given I log in as "Admin" with the password "123456" @@ -22,9 +22,9 @@ Feature: APK-Generation Pending in Admin Area And I wait for the page to be loaded Then I should see the ready apks table: | Id | User | Name | Apk Request Time | - | 2 | Gregor | program 2 | June 2, 2020 11:00 | - | 1 | Superman | program 1 | June 2, 2020 10:00 | - | 3 | Admin | program 3 | June 2, 2020 08:00 | + | 2 | Gregor | project 2 | June 2, 2020 11:00 | + | 1 | Superman | project 1 | June 2, 2020 10:00 | + | 3 | Admin | project 3 | June 2, 2020 08:00 | Scenario: The Rebuild button should rebuild apk and set state to pending. Entry shouldn't be in list anymore Given I log in as "Admin" with the password "123456" @@ -34,11 +34,11 @@ Feature: APK-Generation Pending in Admin Area And I wait for the page to be loaded When I am on "/admin/apk_ready/list" And I wait for the page to be loaded - Then I should not see "program 3" + Then I should not see "project 3" And I wait for the page to be loaded When I am on "/admin/apk_pending/list" And I wait for the page to be loaded - Then I should see "program 3" + Then I should see "project 3" Scenario: The Reset button should reset the apk status, the request time and entry shouldn't be in list anymore Given I log in as "Admin" with the password "123456" @@ -48,8 +48,8 @@ Feature: APK-Generation Pending in Admin Area And I wait for the page to be loaded When I am on "/admin/apk_ready/list" And I wait for the page to be loaded - Then I should not see "program 3" + Then I should not see "project 3" And I wait for the page to be loaded When I am on "/admin/apk_pending/list" And I wait for the page to be loaded - Then I should not see "program 3" + Then I should not see "project 3" diff --git a/tests/BehatFeatures/web/admin/approve_projects.feature b/tests/BehatFeatures/web/admin/approve_projects.feature index 1273778359..df9fe802ca 100644 --- a/tests/BehatFeatures/web/admin/approve_projects.feature +++ b/tests/BehatFeatures/web/admin/approve_projects.feature @@ -1,5 +1,5 @@ @admin -Feature: Admin approve programs +Feature: Admin approve projects Background: Given there are admins: @@ -14,24 +14,24 @@ Feature: Admin approve programs And there are projects: | id | name | description | owned by | upload time | version | language version | visible | - | 1 | program 1 | description1 | Catrobat | 01.01.2014 12:00 | 0.8.5 | 0.94 | true | - | 2 | program 2 | description2 | Catroweb | 22.04.2014 14:00 | 0.8.5 | 0.93 | true | - | 3 | program 3 | description3 | Catroweb | 22.04.2014 14:30 | 0.8.5 | 0.93 | true | - | 4 | program 4 | | Catrobat | 22.04.2014 14:15 | 0.8.5 | 0.93 | true | - | 5 | program 5 | description2 | User1 | 22.04.2014 14:00 | 0.8.5 | 0.93 | false | + | 1 | project 1 | description1 | Catrobat | 01.01.2014 12:00 | 0.8.5 | 0.94 | true | + | 2 | project 2 | description2 | Catroweb | 22.04.2014 14:00 | 0.8.5 | 0.93 | true | + | 3 | project 3 | description3 | Catroweb | 22.04.2014 14:30 | 0.8.5 | 0.93 | true | + | 4 | project 4 | | Catrobat | 22.04.2014 14:15 | 0.8.5 | 0.93 | true | + | 5 | project 5 | description2 | User1 | 22.04.2014 14:00 | 0.8.5 | 0.93 | false | - Scenario: List all programs: + Scenario: List all projects: Given I log in as "Admin" with the password "123456" And I am on "/admin/approve/list" And I wait for the page to be loaded Then I should see the following not approved projects: | Upload Time | Id | User | Name | Visible | Approved | Action | - | January 1, 2014 12:00 | 1 | Catrobat | program 1 | yes | no | Show | - | April 22, 2014 14:00 | 2 | Catroweb | program 2 | yes | no | Show | - | April 22, 2014 14:30 | 3 | Catroweb | program 3 | yes | no | Show | - | April 22, 2014 14:15 | 4 | Catrobat | program 4 | yes | no | Show | - | April 22, 2014 14:00 | 5 | User1 | program 5 | no | no | Show | + | January 1, 2014 12:00 | 1 | Catrobat | project 1 | yes | no | Show | + | April 22, 2014 14:00 | 2 | Catroweb | project 2 | yes | no | Show | + | April 22, 2014 14:30 | 3 | Catroweb | project 3 | yes | no | Show | + | April 22, 2014 14:15 | 4 | Catrobat | project 4 | yes | no | Show | + | April 22, 2014 14:00 | 5 | User1 | project 5 | no | no | Show | Scenario: List projects sorted by upload date ascending @@ -42,11 +42,11 @@ Feature: Admin approve programs And I wait for the page to be loaded Then I should see the following not approved projects: | Upload Time | Id | User | Name | Visible | Approved | Action | - | January 1, 2014 12:00 | 1 | Catrobat | program 1 | yes | no | Show | - | April 22, 2014 14:00 | 2 | Catroweb | program 2 | yes | no | Show | - | April 22, 2014 14:00 | 5 | User1 | program 5 | no | no | Show | - | April 22, 2014 14:15 | 4 | Catrobat | program 4 | yes | no | Show | - | April 22, 2014 14:30 | 3 | Catroweb | program 3 | yes | no | Show | + | January 1, 2014 12:00 | 1 | Catrobat | project 1 | yes | no | Show | + | April 22, 2014 14:00 | 2 | Catroweb | project 2 | yes | no | Show | + | April 22, 2014 14:00 | 5 | User1 | project 5 | no | no | Show | + | April 22, 2014 14:15 | 4 | Catrobat | project 4 | yes | no | Show | + | April 22, 2014 14:30 | 3 | Catroweb | project 3 | yes | no | Show | Scenario: Filter projects by upload date using filter options Given I log in as "Admin" with the password "123456" @@ -55,11 +55,11 @@ Feature: Admin approve programs Then I am on "/admin/approve/list?filter%5Bid%5D%5Btype%5D=&filter%5Bid%5D%5Bvalue%5D=&filter%5Bname%5D%5Btype%5D=&filter%5Bname%5D%5Bvalue%5D=&filter%5Buser__username%5D%5Btype%5D=&filter%5Buser__username%5D%5Bvalue%5D=&filter%5Buploaded_at%5D%5Btype%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bstart%5D=Apr+22%2C+2014%2C+2%3A15%3A00+pm&filter%5Buploaded_at%5D%5Bvalue%5D%5Bend%5D=Apr+22%2C+2014%2C+2%3A30%3A00+pm&filter%5B_page%5D=1&filter%5B_sort_by%5D=id&filter%5B_sort_order%5D=ASC&filter%5B_per_page%5D=32" Then I should see the following not approved projects: | Upload Time | Id | User | Name | Visible | Approved | Action | - | April 22, 2014 14:30 | 3 | Catroweb | program 3 | yes | no | Show | - | April 22, 2014 14:15 | 4 | Catrobat | program 4 | yes | no | Show | - And I should not see "program 1" - And I should not see "program 2" - And I should not see "program 5" + | April 22, 2014 14:30 | 3 | Catroweb | project 3 | yes | no | Show | + | April 22, 2014 14:15 | 4 | Catrobat | project 4 | yes | no | Show | + And I should not see "project 1" + And I should not see "project 2" + And I should not see "project 5" Scenario: Filter projects by user using filter options @@ -69,24 +69,24 @@ Feature: Admin approve programs Then I am on "/admin/approve/list?filter%5Bid%5D%5Btype%5D=&filter%5Bid%5D%5Bvalue%5D=&filter%5Bname%5D%5Btype%5D=&filter%5Bname%5D%5Bvalue%5D=&filter%5Buser__username%5D%5Btype%5D=&filter%5Buser__username%5D%5Bvalue%5D=Catroweb&filter%5Buploaded_at%5D%5Btype%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bstart%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bend%5D=&filter%5B_page%5D=1&filter%5B_sort_by%5D=id&filter%5B_sort_order%5D=ASC&filter%5B_per_page%5D=32" Then I should see the following not approved projects: | Upload Time | Id | User | Name | Visible | Approved | Action | - | April 22, 2014 14:00 | 2 | Catroweb | program 2 | yes | no | Show | - | April 22, 2014 14:30 | 3 | Catroweb | program 3 | yes | no | Show | - And I should not see "program 1" - And I should not see "program 4" - And I should not see "program 5" + | April 22, 2014 14:00 | 2 | Catroweb | project 2 | yes | no | Show | + | April 22, 2014 14:30 | 3 | Catroweb | project 3 | yes | no | Show | + And I should not see "project 1" + And I should not see "project 4" + And I should not see "project 5" Scenario: Filter projects by name using filter options Given I log in as "Admin" with the password "123456" And I am on "/admin/approve/list" And I wait for the page to be loaded - Then I am on "/admin/approve/list?filter%5Bid%5D%5Btype%5D=&filter%5Bid%5D%5Bvalue%5D=&filter%5Bname%5D%5Btype%5D=&filter%5Bname%5D%5Bvalue%5D=program+1&filter%5Buser__username%5D%5Btype%5D=&filter%5Buser__username%5D%5Bvalue%5D=&filter%5Buploaded_at%5D%5Btype%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bstart%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bend%5D=&filter%5B_page%5D=1&filter%5B_sort_by%5D=id&filter%5B_sort_order%5D=ASC&filter%5B_per_page%5D=32" + Then I am on "/admin/approve/list?filter%5Bid%5D%5Btype%5D=&filter%5Bid%5D%5Bvalue%5D=&filter%5Bname%5D%5Btype%5D=&filter%5Bname%5D%5Bvalue%5D=project+1&filter%5Buser__username%5D%5Btype%5D=&filter%5Buser__username%5D%5Bvalue%5D=&filter%5Buploaded_at%5D%5Btype%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bstart%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bend%5D=&filter%5B_page%5D=1&filter%5B_sort_by%5D=id&filter%5B_sort_order%5D=ASC&filter%5B_per_page%5D=32" Then I should see the following not approved projects: | Upload Time | Id | User | Name | Visible | Approved | Action | - | January 1, 2014 12:00 | 1 | Catrobat | program 1 | yes | no | Show | - And I should not see "program 2" - And I should not see "program 3" - And I should not see "program 4" - And I should not see "program 5" + | January 1, 2014 12:00 | 1 | Catrobat | project 1 | yes | no | Show | + And I should not see "project 2" + And I should not see "project 3" + And I should not see "project 4" + And I should not see "project 5" Scenario: Filter projects by id using filter options Given I log in as "Admin" with the password "123456" @@ -95,23 +95,23 @@ Feature: Admin approve programs Then I am on "/admin/approve/list?filter%5Bid%5D%5Btype%5D=&filter%5Bid%5D%5Bvalue%5D=2&filter%5Bname%5D%5Btype%5D=&filter%5Bname%5D%5Bvalue%5D=&filter%5Buser__username%5D%5Btype%5D=&filter%5Buser__username%5D%5Bvalue%5D=&filter%5Buploaded_at%5D%5Btype%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bstart%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bend%5D=&filter%5B_page%5D=1&filter%5B_sort_by%5D=id&filter%5B_sort_order%5D=ASC&filter%5B_per_page%5D=32" Then I should see the following not approved projects: | Upload Time | Id | User | Name | Visible | Approved | Action | - | April 22, 2014 14:00 | 2 | Catroweb | program 2 | yes | no | Show | - And I should not see "program 1" - And I should not see "program 3" - And I should not see "program 4" - And I should not see "program 5" + | April 22, 2014 14:00 | 2 | Catroweb | project 2 | yes | no | Show | + And I should not see "project 1" + And I should not see "project 3" + And I should not see "project 4" + And I should not see "project 5" - Scenario: Admin should be able to change the visibility of the program + Scenario: Admin should be able to change the visibility of the project Given I log in as "Admin" with the password "123456" And I am on "/admin/approve/list" And I wait for the page to be loaded And I change the visibility of the project number "5" in the approve list to "yes" Then I am on "/app" And I wait for the page to be loaded - Then I should see "program 5" + Then I should see "project 5" And I am on "/admin/approve/list" And I wait for the page to be loaded - Then I should see "program 5" + Then I should see "project 5" Scenario: Admin should be able to change if project is approved Given I log in as "Admin" with the password "123456" @@ -121,10 +121,10 @@ Feature: Admin approve programs And I change the approval of the project number "2" in the approve list to "yes" And I am on "/app" And I wait for the page to be loaded - Then I should see "program 2" + Then I should see "project 2" And I am on "/admin/approve/list" And I wait for the page to be loaded - Then I should not see "program 2" + Then I should not see "project 2" Scenario: Clicking on the user should take me to the page where I can edit user information @@ -137,13 +137,13 @@ Feature: Admin approve programs And I should see "Email" - Scenario: Clicking on the show button should take me to the page with program details + Scenario: Clicking on the show button should take me to the page with project details Given I log in as "Admin" with the password "123456" Given I am on "/admin/approve/list" And I wait for the page to be loaded And I click on the show button of project with id "3" in the approve list Then I should be on "/admin/approve/3/show" - And I should see "program 3" + And I should see "project 3" And I should see "description3" And I should see "Catroweb" And I should see "Images" @@ -155,11 +155,11 @@ Feature: Admin approve programs Given I log in as "Admin" with the password "123456" Given I am on "/admin/approve/list" And I wait for the page to be loaded - And I click on the project name "program 5" + And I click on the project name "project 5" And I wait for the page to be loaded Then I should be on "/admin/approve/5/show" And I should see "Approve Projects" - And I should see "program 5" + And I should see "project 5" And I should see "User" And I should see "User1" And I should see "Update" diff --git a/tests/BehatFeatures/web/admin/example_programs.feature b/tests/BehatFeatures/web/admin/example_projects.feature similarity index 57% rename from tests/BehatFeatures/web/admin/example_programs.feature rename to tests/BehatFeatures/web/admin/example_projects.feature index f1bc884e95..3664093347 100644 --- a/tests/BehatFeatures/web/admin/example_programs.feature +++ b/tests/BehatFeatures/web/admin/example_projects.feature @@ -1,6 +1,6 @@ @admin -Feature: Adminius example programs - It should be possible to list all example programs, sort and filter etc. +Feature: Adminius example projects + It should be possible to list all example projects, sort and filter etc. Background: Given there are admins: @@ -15,10 +15,10 @@ Feature: Adminius example programs And there are projects: | id | name | description | owned by | downloads | apk_downloads | views | upload time | version | language version | visible | apk_ready | - | 1337-c0ffee | program 1 | my superman description | Superman | 3 | 2 | 12 | 01.01.2013 12:00 | 0.8.5 | 0.94 | true | true | - | c0ffee-b00b | program 2 | abcef | Gregor | 333 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | - | c01d-cafe | program 3 | abcef | Gregor | 333 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | - | b100d-c01d | program 4 | abc | Superman | 333 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | + | 1337-c0ffee | project 1 | my superman description | Superman | 3 | 2 | 12 | 01.01.2013 12:00 | 0.8.5 | 0.94 | true | true | + | c0ffee-b00b | project 2 | abcef | Gregor | 333 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | + | c01d-cafe | project 3 | abcef | Gregor | 333 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | + | b100d-c01d | project 4 | abc | Superman | 333 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | | dead-beef | to add | add me if u can | Frank Jr. | 123 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | And there are flavors: @@ -28,74 +28,74 @@ Feature: Adminius example programs And following projects are examples: | name | active | priority | flavor | ios_only | - | program 1 | 0 | 1 | arduino | yes | - | program 2 | 1 | 2 | embroidery | no | - | program 3 | 1 | 3 | embroidery | no | - | program 4 | 1 | 3 | arduino | no | + | project 1 | 0 | 1 | arduino | yes | + | project 2 | 1 | 2 | embroidery | no | + | project 3 | 1 | 3 | embroidery | no | + | project 4 | 1 | 3 | arduino | no | - Scenario: List all example programs: + Scenario: List all example projects: Given I log in as "Adminius" with the password "123456" And I am on "/admin/example_program/list" And I wait for the page to be loaded Then I should see the example table: | Id | Project | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | arduino | 1 | - | 2 | program 2 (#c0ffee-b00b) | embroidery | 1 | - | 3 | program 3 (#c01d-cafe) | embroidery | 2 | - | 4 | program 4 (#b100d-c01d) | arduino | 3 | + | 1 | project 1 (#1337-c0ffee) | arduino | 1 | + | 2 | project 2 (#c0ffee-b00b) | embroidery | 1 | + | 3 | project 3 (#c01d-cafe) | embroidery | 2 | + | 4 | project 4 (#b100d-c01d) | arduino | 3 | And I should not see "Adminius" - Scenario: Delete first example Program + Scenario: Delete first example Project Given I log in as "Adminius" with the password "123456" And I am on "/admin/example_program/list" And I wait for the page to be loaded Then I should see the example table: | Id | Project | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | arduino | 1 | - | 2 | program 2 (#c0ffee-b00b) | embroidery | 1 | - | 3 | program 3 (#c01d-cafe) | embroidery | 2 | - | 4 | program 4 (#b100d-c01d) | arduino | 3 | + | 1 | project 1 (#1337-c0ffee) | arduino | 1 | + | 2 | project 2 (#c0ffee-b00b) | embroidery | 1 | + | 3 | project 3 (#c01d-cafe) | embroidery | 2 | + | 4 | project 4 (#b100d-c01d) | arduino | 3 | Then I am on "/admin/example_program/1/delete" And I wait for the page to be loaded Then I click on the first ".btn-danger" button And I wait for the page to be loaded Then I should see the example table: | Id | Project | Flavor | Priority | - | 2 | program 2 (#c0ffee-b00b) | embroidery | 1 | - | 3 | program 3 (#c01d-cafe) | embroidery | 2 | - | 4 | program 4 (#b100d-c01d) | arduino | 3 | + | 2 | project 2 (#c0ffee-b00b) | embroidery | 1 | + | 3 | project 3 (#c01d-cafe) | embroidery | 2 | + | 4 | project 4 (#b100d-c01d) | arduino | 3 | And I should not see "Adminius" - And I should not see "program 1" + And I should not see "project 1" - Scenario: Click on program link + Scenario: Click on project link Given I log in as "Adminius" with the password "123456" And I am on "/admin/example_program/list" And I wait for the page to be loaded Then I should see the example table: | Id | Project | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | arduino | 1 | - | 2 | program 2 (#c0ffee-b00b) | embroidery | 1 | - | 3 | program 3 (#c01d-cafe) | embroidery | 2 | - | 4 | program 4 (#b100d-c01d) | arduino | 3 | - And I click on the "program 1 (#1337-c0ffee)" link + | 1 | project 1 (#1337-c0ffee) | arduino | 1 | + | 2 | project 2 (#c0ffee-b00b) | embroidery | 1 | + | 3 | project 3 (#c01d-cafe) | embroidery | 2 | + | 4 | project 4 (#b100d-c01d) | arduino | 3 | + And I click on the "project 1 (#1337-c0ffee)" link And I wait for the page to be loaded - Then I should see "Show \"program 1 (#1337-c0ffee)\"" + Then I should see "Show \"project 1 (#1337-c0ffee)\"" - Scenario: Adding an example Program (success) + Scenario: Adding an example Project (success) Given I log in as "Adminius" with the password "123456" And I am on "/admin/example_program/list" And I wait for the page to be loaded Then I should see the example table: | Id | Project | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | arduino | 1 | - | 2 | program 2 (#c0ffee-b00b) | embroidery | 1 | - | 3 | program 3 (#c01d-cafe) | embroidery | 2 | - | 4 | program 4 (#b100d-c01d) | arduino | 3 | + | 1 | project 1 (#1337-c0ffee) | arduino | 1 | + | 2 | project 2 (#c0ffee-b00b) | embroidery | 1 | + | 3 | project 3 (#c01d-cafe) | embroidery | 2 | + | 4 | project 4 (#b100d-c01d) | arduino | 3 | And I click on the "new" link And I wait for the page to be loaded Then I should be on "/admin/example_program/create" When I attach the avatar "galaxy.jpg" to "File" - Then I write "dead-beef" in textarea with label "Program Id" + Then I write "dead-beef" in textarea with label "Project Id" Then I write "3" in textarea with label "Priority" Then I select flavor "arduino" for example project Then I click ".btn-success" @@ -103,33 +103,33 @@ Feature: Adminius example programs And I am on "/admin/example_program/list" Then I should see the example table: | Id | Project | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | arduino | 1 | - | 2 | program 2 (#c0ffee-b00b) | embroidery | 1 | - | 3 | program 3 (#c01d-cafe) | embroidery | 2 | - | 4 | program 4 (#b100d-c01d) | arduino | 3 | + | 1 | project 1 (#1337-c0ffee) | arduino | 1 | + | 2 | project 2 (#c0ffee-b00b) | embroidery | 1 | + | 3 | project 3 (#c01d-cafe) | embroidery | 2 | + | 4 | project 4 (#b100d-c01d) | arduino | 3 | | 5 | to add (#dead-beef) | arduino | 3 | - Scenario: Adding a example Program (fail) + Scenario: Adding a example Project (fail) Given I log in as "Adminius" with the password "123456" And I am on "/admin/example_program/list" And I wait for the page to be loaded Then I should see the example table: | Id | Project | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | arduino | 1 | - | 2 | program 2 (#c0ffee-b00b) | embroidery | 1 | - | 3 | program 3 (#c01d-cafe) | embroidery | 2 | - | 4 | program 4 (#b100d-c01d) | arduino | 3 | + | 1 | project 1 (#1337-c0ffee) | arduino | 1 | + | 2 | project 2 (#c0ffee-b00b) | embroidery | 1 | + | 3 | project 3 (#c01d-cafe) | embroidery | 2 | + | 4 | project 4 (#b100d-c01d) | arduino | 3 | And I click on the "new" link And I wait for the page to be loaded Then I should be on "/admin/example_program/create" When I attach the avatar "galaxy.jpg" to "File" - Then I write "dead-b00f" in textarea with label "Program Id" + Then I write "dead-b00f" in textarea with label "Project Id" Then I write "3" in textarea with label "Priority" Then I click ".btn-success" And I am on "/admin/example_program/list" Then I should see the example table: | Id | Project | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | arduino | 1 | - | 2 | program 2 (#c0ffee-b00b) | embroidery | 1 | - | 3 | program 3 (#c01d-cafe) | embroidery | 2 | - | 4 | program 4 (#b100d-c01d) | arduino | 3 | + | 1 | project 1 (#1337-c0ffee) | arduino | 1 | + | 2 | project 2 (#c0ffee-b00b) | embroidery | 1 | + | 3 | project 3 (#c01d-cafe) | embroidery | 2 | + | 4 | project 4 (#b100d-c01d) | arduino | 3 | diff --git a/tests/BehatFeatures/web/admin/feature_flag.feature b/tests/BehatFeatures/web/admin/feature_flag.feature index b1facd021a..0b4f5ae53a 100644 --- a/tests/BehatFeatures/web/admin/feature_flag.feature +++ b/tests/BehatFeatures/web/admin/feature_flag.feature @@ -1,5 +1,5 @@ @admin -Feature: Admin featured programs +Feature: Admin featured projects Background: Given there are admins: diff --git a/tests/BehatFeatures/web/admin/featured_programs.feature b/tests/BehatFeatures/web/admin/featured_projects.feature similarity index 65% rename from tests/BehatFeatures/web/admin/featured_programs.feature rename to tests/BehatFeatures/web/admin/featured_projects.feature index d8b878d8f5..e54686592a 100644 --- a/tests/BehatFeatures/web/admin/featured_programs.feature +++ b/tests/BehatFeatures/web/admin/featured_projects.feature @@ -1,6 +1,6 @@ @admin -Feature: Admin featured programs - It should be possible to list all featured programs, sort and filter etc. +Feature: Admin featured projects + It should be possible to list all featured projects, sort and filter etc. Background: Given there are admins: @@ -15,10 +15,10 @@ Feature: Admin featured programs And there are projects: | id | name | description | owned by | downloads | apk_downloads | views | upload time | version | language version | visible | apk_ready | - | 1337-c0ffee | program 1 | my superman description | Superman | 3 | 2 | 12 | 01.01.2013 12:00 | 0.8.5 | 0.94 | true | true | - | c0ffee-b00b | program 2 | abcef | Gregor | 333 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | - | c01d-cafe | program 3 | abcef | Gregor | 333 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | - | b100d-c01d | program 4 | abc | Superman | 333 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | + | 1337-c0ffee | project 1 | my superman description | Superman | 3 | 2 | 12 | 01.01.2013 12:00 | 0.8.5 | 0.94 | true | true | + | c0ffee-b00b | project 2 | abcef | Gregor | 333 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | + | c01d-cafe | project 3 | abcef | Gregor | 333 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | + | b100d-c01d | project 4 | abc | Superman | 333 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | | dead-beef | to add | add me if u can | Frank Jr. | 123 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | And there are flavors: @@ -35,252 +35,252 @@ Feature: Admin featured programs | 3 | c01d-cafe | 1 | luna | 2 | no | | 4 | b100d-c01d | false | embroidery | 3 | no | - Scenario: List all featured programs: + Scenario: List all featured projects: Given I log in as "Adminius" with the password "123456" And I am on "/admin/featured_program/list" And I wait for the page to be loaded Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | | pocketcode | 1 | - | 2 | program 2 (#c0ffee-b00b) | | arduino | 1 | - | 3 | program 3 (#c01d-cafe) | | luna | 2 | - | 4 | program 4 (#b100d-c01d) | | embroidery | 3 | + | 1 | project 1 (#1337-c0ffee) | | pocketcode | 1 | + | 2 | project 2 (#c0ffee-b00b) | | arduino | 1 | + | 3 | project 3 (#c01d-cafe) | | luna | 2 | + | 4 | project 4 (#b100d-c01d) | | embroidery | 3 | And I should not see "Adminius" - Scenario: List featured programs just for arduino + Scenario: List featured projects just for arduino Given I log in as "Adminius" with the password "123456" And I am on "/admin/featured_program/list?filter%5Bprogram__name%5D%5Btype%5D=&filter%5Bprogram__name%5D%5Bvalue%5D=&filter%5Bfor_ios%5D%5Btype%5D=&filter%5Bfor_ios%5D%5Bvalue%5D=&filter%5Bactive%5D%5Btype%5D=&filter%5Bactive%5D%5Bvalue%5D=&filter%5Bpriority%5D%5Btype%5D=&filter%5Bpriority%5D%5Bvalue%5D=&filter%5Bflavor%5D%5Btype%5D=&filter%5Bflavor%5D%5Bvalue%5D=3&filter%5B_page%5D=1&filter%5B_sort_by%5D=id&filter%5B_sort_order%5D=ASC&filter%5B_per_page%5D=32" And I wait for the page to be loaded Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 2 | program 2 (#c0ffee-b00b) | | arduino | 1 | + | 2 | project 2 (#c0ffee-b00b) | | arduino | 1 | And I should not see "Adminius" - And I should not see "program 1" - And I should not see "program 3" + And I should not see "project 1" + And I should not see "project 3" - Scenario: List featured programs just for IOS + Scenario: List featured projects just for IOS Given I log in as "Adminius" with the password "123456" And I am on "/admin/featured_program/list?filter%5Bprogram__name%5D%5Btype%5D=&filter%5Bprogram__name%5D%5Bvalue%5D=&filter%5Bfor_ios%5D%5Btype%5D=&filter%5Bfor_ios%5D%5Bvalue%5D=1&filter%5Bactive%5D%5Btype%5D=&filter%5Bactive%5D%5Bvalue%5D=&filter%5Bpriority%5D%5Btype%5D=&filter%5Bpriority%5D%5Bvalue%5D=&filter%5Bflavor%5D%5Btype%5D=&filter%5Bflavor%5D%5Bvalue%5D=&filter%5B_page%5D=1&filter%5B_sort_by%5D=id&filter%5B_sort_order%5D=ASC&filter%5B_per_page%5D=32" And I wait for the page to be loaded Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | | pocketcode | 1 | + | 1 | project 1 (#1337-c0ffee) | | pocketcode | 1 | And I should not see "Adminius" - And I should not see "program 2" - And I should not see "program 3" + And I should not see "project 2" + And I should not see "project 3" - Scenario: List featured programs with priority above 1 + Scenario: List featured projects with priority above 1 Given I log in as "Adminius" with the password "123456" And I am on "/admin/featured_program/list?filter%5Bprogram__name%5D%5Btype%5D=&filter%5Bprogram__name%5D%5Bvalue%5D=&filter%5Bfor_ios%5D%5Btype%5D=&filter%5Bfor_ios%5D%5Bvalue%5D=&filter%5Bactive%5D%5Btype%5D=&filter%5Bactive%5D%5Bvalue%5D=&filter%5Bpriority%5D%5Btype%5D=2&filter%5Bpriority%5D%5Bvalue%5D=1&filter%5Bflavor%5D%5Btype%5D=&filter%5Bflavor%5D%5Bvalue%5D=&filter%5B_page%5D=1&filter%5B_sort_by%5D=id&filter%5B_sort_order%5D=ASC&filter%5B_per_page%5D=32" And I wait for the page to be loaded Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 3 | program 3 (#c01d-cafe) | | luna | 2 | - | 4 | program 4 (#b100d-c01d) | | embroidery | 3 | + | 3 | project 3 (#c01d-cafe) | | luna | 2 | + | 4 | project 4 (#b100d-c01d) | | embroidery | 3 | And I should not see "Adminius" - And I should not see "program 1" - And I should not see "program 2" + And I should not see "project 1" + And I should not see "project 2" - Scenario: List only active featured programs + Scenario: List only active featured projects Given I log in as "Adminius" with the password "123456" And I am on "/admin/featured_program/list?filter%5Bprogram__name%5D%5Btype%5D=&filter%5Bprogram__name%5D%5Bvalue%5D=&filter%5Bfor_ios%5D%5Btype%5D=&filter%5Bfor_ios%5D%5Bvalue%5D=&filter%5Bactive%5D%5Btype%5D=&filter%5Bactive%5D%5Bvalue%5D=1&filter%5Bpriority%5D%5Btype%5D=&filter%5Bpriority%5D%5Bvalue%5D=&filter%5Bflavor%5D%5Btype%5D=&filter%5Bflavor%5D%5Bvalue%5D=&filter%5B_page%5D=1&filter%5B_sort_by%5D=id&filter%5B_sort_order%5D=ASC&filter%5B_per_page%5D=32" And I wait for the page to be loaded Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | | pocketcode | 1 | - | 3 | program 3 (#c01d-cafe) | | luna | 2 | + | 1 | project 1 (#1337-c0ffee) | | pocketcode | 1 | + | 3 | project 3 (#c01d-cafe) | | luna | 2 | And I should not see "Adminius" - And I should not see "program 2" - And I should not see "program 4" + And I should not see "project 2" + And I should not see "project 4" - Scenario: Delete first Featured Program + Scenario: Delete first Featured Project Given I log in as "Adminius" with the password "123456" And I am on "/admin/featured_program/list" And I wait for the page to be loaded Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | | pocketcode | 1 | - | 2 | program 2 (#c0ffee-b00b) | | arduino | 1 | - | 3 | program 3 (#c01d-cafe) | | luna | 2 | - | 4 | program 4 (#b100d-c01d) | | embroidery | 3 | + | 1 | project 1 (#1337-c0ffee) | | pocketcode | 1 | + | 2 | project 2 (#c0ffee-b00b) | | arduino | 1 | + | 3 | project 3 (#c01d-cafe) | | luna | 2 | + | 4 | project 4 (#b100d-c01d) | | embroidery | 3 | Then I am on "/admin/featured_program/1/delete" And I wait for the page to be loaded Then I click on the first ".btn-danger" button And I wait for the page to be loaded Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 2 | program 2 (#c0ffee-b00b) | | arduino | 1 | - | 3 | program 3 (#c01d-cafe) | | luna | 2 | - | 4 | program 4 (#b100d-c01d) | | embroidery | 3 | + | 2 | project 2 (#c0ffee-b00b) | | arduino | 1 | + | 3 | project 3 (#c01d-cafe) | | luna | 2 | + | 4 | project 4 (#b100d-c01d) | | embroidery | 3 | And I should not see "Adminius" - And I should not see "program 1" + And I should not see "project 1" Then I am on "/app" And I wait for the page to be loaded - Then I should not see "featured program" + Then I should not see "featured project" - Scenario: Click on program link + Scenario: Click on project link Given I log in as "Adminius" with the password "123456" And I am on "/admin/featured_program/list" And I wait for the page to be loaded Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | | pocketcode | 1 | - | 2 | program 2 (#c0ffee-b00b) | | arduino | 1 | - | 3 | program 3 (#c01d-cafe) | | luna | 2 | - | 4 | program 4 (#b100d-c01d) | | embroidery | 3 | - And I click on the "program 1 (#1337-c0ffee)" link + | 1 | project 1 (#1337-c0ffee) | | pocketcode | 1 | + | 2 | project 2 (#c0ffee-b00b) | | arduino | 1 | + | 3 | project 3 (#c01d-cafe) | | luna | 2 | + | 4 | project 4 (#b100d-c01d) | | embroidery | 3 | + And I click on the "project 1 (#1337-c0ffee)" link And I wait for the page to be loaded - Then I should see "Show \"program 1 (#1337-c0ffee)\"" + Then I should see "Show \"project 1 (#1337-c0ffee)\"" - Scenario: Adding a featured Program (success) + Scenario: Adding a featured Project (success) Given I log in as "Adminius" with the password "123456" And I am on "/admin/featured_program/list" And I wait for the page to be loaded Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | | pocketcode | 1 | - | 2 | program 2 (#c0ffee-b00b) | | arduino | 1 | - | 3 | program 3 (#c01d-cafe) | | luna | 2 | - | 4 | program 4 (#b100d-c01d) | | embroidery | 3 | + | 1 | project 1 (#1337-c0ffee) | | pocketcode | 1 | + | 2 | project 2 (#c0ffee-b00b) | | arduino | 1 | + | 3 | project 3 (#c01d-cafe) | | luna | 2 | + | 4 | project 4 (#b100d-c01d) | | embroidery | 3 | And I click on the "new" link And I wait for the page to be loaded Then I should be on "/admin/featured_program/create" When I attach the avatar "galaxy.jpg" to "File" - Then I write "dead-beef" in textarea with label "Program Id Or Url" + Then I write "dead-beef" in textarea with label "Project Id Or Url" Then I write "3" in textarea with label "Priority" Then I click ".btn-success" Then I should see "has been successfully created" And I am on "/admin/featured_program/list" Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | | pocketcode | 1 | - | 2 | program 2 (#c0ffee-b00b) | | arduino | 1 | - | 3 | program 3 (#c01d-cafe) | | luna | 2 | - | 4 | program 4 (#b100d-c01d) | | embroidery | 3 | + | 1 | project 1 (#1337-c0ffee) | | pocketcode | 1 | + | 2 | project 2 (#c0ffee-b00b) | | arduino | 1 | + | 3 | project 3 (#c01d-cafe) | | luna | 2 | + | 4 | project 4 (#b100d-c01d) | | embroidery | 3 | | 5 | to add (#dead-beef) | | pocketcode | 3 | - Scenario: Adding a featured Program (fail) + Scenario: Adding a featured Project (fail) Given I log in as "Adminius" with the password "123456" And I am on "/admin/featured_program/list" And I wait for the page to be loaded Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | | pocketcode | 1 | - | 2 | program 2 (#c0ffee-b00b) | | arduino | 1 | - | 3 | program 3 (#c01d-cafe) | | luna | 2 | - | 4 | program 4 (#b100d-c01d) | | embroidery | 3 | + | 1 | project 1 (#1337-c0ffee) | | pocketcode | 1 | + | 2 | project 2 (#c0ffee-b00b) | | arduino | 1 | + | 3 | project 3 (#c01d-cafe) | | luna | 2 | + | 4 | project 4 (#b100d-c01d) | | embroidery | 3 | And I click on the "new" link And I wait for the page to be loaded Then I should be on "/admin/featured_program/create" When I attach the avatar "galaxy.jpg" to "File" - Then I write "dead-b00f" in textarea with label "Program Id Or Url" + Then I write "dead-b00f" in textarea with label "Project Id Or Url" Then I write "3" in textarea with label "Priority" Then I click ".btn-success" And I am on "/admin/featured_program/list" Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | | pocketcode | 1 | - | 2 | program 2 (#c0ffee-b00b) | | arduino | 1 | - | 3 | program 3 (#c01d-cafe) | | luna | 2 | - | 4 | program 4 (#b100d-c01d) | | embroidery | 3 | + | 1 | project 1 (#1337-c0ffee) | | pocketcode | 1 | + | 2 | project 2 (#c0ffee-b00b) | | arduino | 1 | + | 3 | project 3 (#c01d-cafe) | | luna | 2 | + | 4 | project 4 (#b100d-c01d) | | embroidery | 3 | - Scenario: Adding a featured Program (wrong picture) + Scenario: Adding a featured Project (wrong picture) Given I log in as "Adminius" with the password "123456" And I am on "/admin/featured_program/list" And I wait for the page to be loaded Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | | pocketcode | 1 | - | 2 | program 2 (#c0ffee-b00b) | | arduino | 1 | - | 3 | program 3 (#c01d-cafe) | | luna | 2 | - | 4 | program 4 (#b100d-c01d) | | embroidery | 3 | + | 1 | project 1 (#1337-c0ffee) | | pocketcode | 1 | + | 2 | project 2 (#c0ffee-b00b) | | arduino | 1 | + | 3 | project 3 (#c01d-cafe) | | luna | 2 | + | 4 | project 4 (#b100d-c01d) | | embroidery | 3 | And I click on the "new" link And I wait for the page to be loaded Then I should be on "/admin/featured_program/create" When I attach the avatar "fail.tif" to "File" - Then I write "dead-b00f" in textarea with label "Program Id Or Url" + Then I write "dead-b00f" in textarea with label "Project Id Or Url" Then I write "3" in textarea with label "Priority" Then I click ".btn-success" Then I should see "Error" - Scenario: Adding a featured Program with URL - Project (success) + Scenario: Adding a featured Project with URL - Project (success) Given I log in as "Adminius" with the password "123456" And I am on "/admin/featured_program/list" And I wait for the page to be loaded Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | | pocketcode | 1 | - | 2 | program 2 (#c0ffee-b00b) | | arduino | 1 | - | 3 | program 3 (#c01d-cafe) | | luna | 2 | - | 4 | program 4 (#b100d-c01d) | | embroidery | 3 | + | 1 | project 1 (#1337-c0ffee) | | pocketcode | 1 | + | 2 | project 2 (#c0ffee-b00b) | | arduino | 1 | + | 3 | project 3 (#c01d-cafe) | | luna | 2 | + | 4 | project 4 (#b100d-c01d) | | embroidery | 3 | And I click on the "new" link And I wait for the page to be loaded Then I should be on "/admin/featured_program/create" When I attach the avatar "galaxy.jpg" to "File" Then I write "1" in textarea with label "Use Url" - Then I write "catrobat.at/app/project/dead-beef" in textarea with label "Program Id Or Url" + Then I write "catrobat.at/app/project/dead-beef" in textarea with label "Project Id Or Url" Then I write "3" in textarea with label "Priority" Then I click ".btn-success" Then I should see "has been successfully created" And I am on "/admin/featured_program/list" Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | | pocketcode | 1 | - | 2 | program 2 (#c0ffee-b00b) | | arduino | 1 | - | 3 | program 3 (#c01d-cafe) | | luna | 2 | - | 4 | program 4 (#b100d-c01d) | | embroidery | 3 | + | 1 | project 1 (#1337-c0ffee) | | pocketcode | 1 | + | 2 | project 2 (#c0ffee-b00b) | | arduino | 1 | + | 3 | project 3 (#c01d-cafe) | | luna | 2 | + | 4 | project 4 (#b100d-c01d) | | embroidery | 3 | | 5 | to add (#dead-beef) | | pocketcode | 3 | - Scenario: Adding a featured Program with URL - Extern (success) + Scenario: Adding a featured Project with URL - Extern (success) Given I log in as "Adminius" with the password "123456" And I am on "/admin/featured_program/list" And I wait for the page to be loaded Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | | pocketcode | 1 | - | 2 | program 2 (#c0ffee-b00b) | | arduino | 1 | - | 3 | program 3 (#c01d-cafe) | | luna | 2 | - | 4 | program 4 (#b100d-c01d) | | embroidery | 3 | + | 1 | project 1 (#1337-c0ffee) | | pocketcode | 1 | + | 2 | project 2 (#c0ffee-b00b) | | arduino | 1 | + | 3 | project 3 (#c01d-cafe) | | luna | 2 | + | 4 | project 4 (#b100d-c01d) | | embroidery | 3 | And I click on the "new" link And I wait for the page to be loaded Then I should be on "/admin/featured_program/create" When I attach the avatar "galaxy.jpg" to "File" When I click ".iCheck-helper" Then the "Use Url" checkbox should be checked - Then I write "http://www.google.com" in textarea with label "Program Id Or Url" + Then I write "http://www.google.com" in textarea with label "Project Id Or Url" Then I write "3" in textarea with label "Priority" Then I click ".btn-success" And I am on "/admin/featured_program/list" Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | | pocketcode | 1 | - | 2 | program 2 (#c0ffee-b00b) | | arduino | 1 | - | 3 | program 3 (#c01d-cafe) | | luna | 2 | - | 4 | program 4 (#b100d-c01d) | | embroidery | 3 | + | 1 | project 1 (#1337-c0ffee) | | pocketcode | 1 | + | 2 | project 2 (#c0ffee-b00b) | | arduino | 1 | + | 3 | project 3 (#c01d-cafe) | | luna | 2 | + | 4 | project 4 (#b100d-c01d) | | embroidery | 3 | | 5 | | http://www.google.com | pocketcode | 3 | - Scenario: Adding a featured Program with URL - Project (fail) + Scenario: Adding a featured Project with URL - Project (fail) Given I log in as "Adminius" with the password "123456" And I am on "/admin/featured_program/list" And I wait for the page to be loaded Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | | pocketcode | 1 | - | 2 | program 2 (#c0ffee-b00b) | | arduino | 1 | - | 3 | program 3 (#c01d-cafe) | | luna | 2 | - | 4 | program 4 (#b100d-c01d) | | embroidery | 3 | + | 1 | project 1 (#1337-c0ffee) | | pocketcode | 1 | + | 2 | project 2 (#c0ffee-b00b) | | arduino | 1 | + | 3 | project 3 (#c01d-cafe) | | luna | 2 | + | 4 | project 4 (#b100d-c01d) | | embroidery | 3 | And I click on the "new" link And I wait for the page to be loaded Then I should be on "/admin/featured_program/create" When I attach the avatar "galaxy.jpg" to "File" - Then I write "catrobat.at/app/project/dead-b00f" in textarea with label "Program Id Or Url" + Then I write "catrobat.at/app/project/dead-b00f" in textarea with label "Project Id Or Url" Then I write "3" in textarea with label "Priority" Then I click ".btn-success" Then I should see "Error" And I am on "/admin/featured_program/list" Then I should see the featured table: | Id | Project | Url | Flavor | Priority | - | 1 | program 1 (#1337-c0ffee) | | pocketcode | 1 | - | 2 | program 2 (#c0ffee-b00b) | | arduino | 1 | - | 3 | program 3 (#c01d-cafe) | | luna | 2 | - | 4 | program 4 (#b100d-c01d) | | embroidery | 3 | \ No newline at end of file + | 1 | project 1 (#1337-c0ffee) | | pocketcode | 1 | + | 2 | project 2 (#c0ffee-b00b) | | arduino | 1 | + | 3 | project 3 (#c01d-cafe) | | luna | 2 | + | 4 | project 4 (#b100d-c01d) | | embroidery | 3 | \ No newline at end of file diff --git a/tests/BehatFeatures/web/admin/projects_overview.feature b/tests/BehatFeatures/web/admin/projects_overview.feature index 0d01b772a0..9f5873c653 100644 --- a/tests/BehatFeatures/web/admin/projects_overview.feature +++ b/tests/BehatFeatures/web/admin/projects_overview.feature @@ -12,11 +12,11 @@ Feature: Admin all projects | Pauli | 123456 | dddddddddd | dev2@pocketcode.org | 3 | And there are downloadable projects: | id | name | description | owned by | downloads | flavor | views | upload time | visible | - | 1 | program 1 | a classy program | Karim | 3 | pocketcode | 120 | 01.01.2019 12:00 | true | - | 2 | program 2 | abcef | Karim | 123 | luna | 921 | 02.04.2019 13:00 | true | - | 3 | program 3 | description | Pauli | 234 | arduino | 122 | 06.04.2019 13:02 | false | - | 4 | program 4 | abcdef | Pauli | 222 | pocketcode | 12 | 02.04.2019 13:10 | false | - | 5 | program 5 | abcd | Karim | 111 | pocketcode | 15 | 22.04.2019 13:00 | false | + | 1 | project 1 | a classy project | Karim | 3 | pocketcode | 120 | 01.01.2019 12:00 | true | + | 2 | project 2 | abcef | Karim | 123 | luna | 921 | 02.04.2019 13:00 | true | + | 3 | project 3 | description | Pauli | 234 | arduino | 122 | 06.04.2019 13:02 | false | + | 4 | project 4 | abcdef | Pauli | 222 | pocketcode | 12 | 02.04.2019 13:10 | false | + | 5 | project 5 | abcd | Karim | 111 | pocketcode | 15 | 22.04.2019 13:00 | false | Scenario: Al projects should be sorted by upload date descending @@ -25,11 +25,11 @@ Feature: Admin all projects And I wait for the page to be loaded Then I should see the table with all projects in the following order: | Uploaded At | Name | User | Flavor | Views | Downloads | private | Approved | Visible | Action | - | April 22, 2019 13:00 | program 5 | Karim | pocketcode | 15 | 111 | no | no | no | Show | - | April 6, 2019 13:02 | program 3 | Pauli | arduino | 122 | 234 | no | no | no | Show | - | April 2, 2019 13:10 | program 4 | Pauli | pocketcode | 12 | 222 | no | no | no | Show | - | April 2, 2019 13:00 | program 2 | Karim | luna | 921 | 123 | no | no | yes | Show | - | January 1, 2019 12:00 | program 1 | Karim | pocketcode | 120 | 3 | no | no | yes | Show | + | April 22, 2019 13:00 | project 5 | Karim | pocketcode | 15 | 111 | no | no | no | Show | + | April 6, 2019 13:02 | project 3 | Pauli | arduino | 122 | 234 | no | no | no | Show | + | April 2, 2019 13:10 | project 4 | Pauli | pocketcode | 12 | 222 | no | no | no | Show | + | April 2, 2019 13:00 | project 2 | Karim | luna | 921 | 123 | no | no | yes | Show | + | January 1, 2019 12:00 | project 1 | Karim | pocketcode | 120 | 3 | no | no | yes | Show | Scenario: List all projects sorted by views ascending @@ -40,11 +40,11 @@ Feature: Admin all projects And I wait for the page to be loaded Then I should see the table with all projects in the following order: | Uploaded At | Name | User | Flavor | Views | Downloads | private | Approved | Visible | Action | - | April 2, 2019 13:10 | program 4 | Pauli | pocketcode | 12 | 222 | no | no | no | Show | - | April 22, 2019 13:00 | program 5 | Karim | pocketcode | 15 | 111 | no | no | no | Show | - | January 1, 2019 12:00 | program 1 | Karim | pocketcode | 120 | 3 | no | no | yes | Show | - | April 6, 2019 13:02 | program 3 | Pauli | arduino | 122 | 234 | no | no | no | Show | - | April 2, 2019 13:00 | program 2 | Karim | luna | 921 | 123 | no | no | yes | Show | + | April 2, 2019 13:10 | project 4 | Pauli | pocketcode | 12 | 222 | no | no | no | Show | + | April 22, 2019 13:00 | project 5 | Karim | pocketcode | 15 | 111 | no | no | no | Show | + | January 1, 2019 12:00 | project 1 | Karim | pocketcode | 120 | 3 | no | no | yes | Show | + | April 6, 2019 13:02 | project 3 | Pauli | arduino | 122 | 234 | no | no | no | Show | + | April 2, 2019 13:00 | project 2 | Karim | luna | 921 | 123 | no | no | yes | Show | Scenario: List all projects sorted by downloads ascending Given I log in as "Admin" with the password "123456" @@ -54,11 +54,11 @@ Feature: Admin all projects And I wait for the page to be loaded Then I should see the table with all projects in the following order: | Uploaded At | Name | User | Flavor | Views | Downloads | private | Approved | Visible | Action | - | January 1, 2019 12:00 | program 1 | Karim | pocketcode | 120 | 3 | no | no | yes | Show | - | April 22, 2019 13:00 | program 5 | Karim | pocketcode | 15 | 111 | no | no | no | Show | - | April 2, 2019 13:00 | program 2 | Karim | luna | 921 | 123 | no | no | yes | Show | - | April 2, 2019 13:10 | program 4 | Pauli | pocketcode | 12 | 222 | no | no | no | Show | - | April 6, 2019 13:02 | program 3 | Pauli | arduino | 122 | 234 | no | no | no | Show | + | January 1, 2019 12:00 | project 1 | Karim | pocketcode | 120 | 3 | no | no | yes | Show | + | April 22, 2019 13:00 | project 5 | Karim | pocketcode | 15 | 111 | no | no | no | Show | + | April 2, 2019 13:00 | project 2 | Karim | luna | 921 | 123 | no | no | yes | Show | + | April 2, 2019 13:10 | project 4 | Pauli | pocketcode | 12 | 222 | no | no | no | Show | + | April 6, 2019 13:02 | project 3 | Pauli | arduino | 122 | 234 | no | no | no | Show | Scenario: List all projects sorted by ute ascendin Pauli |g Given I log in as "Admin" with the password "123456" @@ -68,11 +68,11 @@ Feature: Admin all projects And I wait for the page to be loaded Then I should see the table with all projects in the following order: | Uploaded At | User | Name | Flavor | Views | Downloads | private | Approved | Visible | Action | - | January 1, 2019 12:00 | program 1 | Karim | pocketcode | 120 | 3 | no | no | yes | Show | - | April 2, 2019 13:00 | program 2 | Karim | luna | 921 | 123 | no | no | yes | Show | - | April 2, 2019 13:10 | program 4 | Pauli | pocketcode | 12 | 222 | no | no | no | Show | - | April 6, 2019 13:02 | program 3 | Pauli | arduino | 122 | 234 | no | no | no | Show | - | April 22, 2019 13:00 | program 5 | Karim | pocketcode | 15 | 111 | no | no | no | Show | + | January 1, 2019 12:00 | project 1 | Karim | pocketcode | 120 | 3 | no | no | yes | Show | + | April 2, 2019 13:00 | project 2 | Karim | luna | 921 | 123 | no | no | yes | Show | + | April 2, 2019 13:10 | project 4 | Pauli | pocketcode | 12 | 222 | no | no | no | Show | + | April 6, 2019 13:02 | project 3 | Pauli | arduino | 122 | 234 | no | no | no | Show | + | April 22, 2019 13:00 | project 5 | Karim | pocketcode | 15 | 111 | no | no | no | Show | Scenario: Filter projects by upload date using filter options @@ -82,25 +82,25 @@ Feature: Admin all projects Then I am on "/admin/projects/list?filter%5Bid%5D%5Btype%5D=&filter%5Bid%5D%5Bvalue%5D=&filter%5Bname%5D%5Btype%5D=&filter%5Bname%5D%5Bvalue%5D=&filter%5Buser__username%5D%5Btype%5D=&filter%5Buser__username%5D%5Bvalue%5D=&filter%5Buploaded_at%5D%5Btype%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bstart%5D=Apr+3%2C+2019%2C+4%3A38%3A58+pm&filter%5Buploaded_at%5D%5Bvalue%5D%5Bend%5D=Apr+24%2C+2019%2C+4%3A31%3A40+pm&filter%5B_page%5D=1&filter%5B_sort_by%5D=uploaded_at&filter%5B_sort_order%5D=DESC&filter%5B_per_page%5D=32" Then I should see the table with all projects in the following order: | Uploaded At | Name | User | Flavor | Views | Downloads | private | Approved | Visible | Action | - | April 22, 2019 13:00 | program 5 | Karim | pocketcode | 15 | 111 | no | no | no | Show | - | April 6, 2019 13:02 | program 3 | Pauli | arduino | 122 | 234 | no | no | no | Show | - And I should not see "program 1" - And I should not see "program 2" - And I should not see "program 4" + | April 22, 2019 13:00 | project 5 | Karim | pocketcode | 15 | 111 | no | no | no | Show | + | April 6, 2019 13:02 | project 3 | Pauli | arduino | 122 | 234 | no | no | no | Show | + And I should not see "project 1" + And I should not see "project 2" + And I should not see "project 4" Scenario: Filter projects by name using filter options Given I log in as "Admin" with the password "123456" And I am on "/admin/projects/list" And I wait for the page to be loaded - Then I am on "/admin/projects/list?filter%5Bid%5D%5Btype%5D=&filter%5Bid%5D%5Bvalue%5D=&filter%5Bname%5D%5Btype%5D=&filter%5Bname%5D%5Bvalue%5D=program+2&filter%5Buser__username%5D%5Btype%5D=&filter%5Buser__username%5D%5Bvalue%5D=&filter%5Buploaded_at%5D%5Btype%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bstart%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bend%5D=&filter%5B_page%5D=1&filter%5B_sort_by%5D=uploaded_at&filter%5B_sort_order%5D=DESC&filter%5B_per_page%5D=32" + Then I am on "/admin/projects/list?filter%5Bid%5D%5Btype%5D=&filter%5Bid%5D%5Bvalue%5D=&filter%5Bname%5D%5Btype%5D=&filter%5Bname%5D%5Bvalue%5D=project+2&filter%5Buser__username%5D%5Btype%5D=&filter%5Buser__username%5D%5Bvalue%5D=&filter%5Buploaded_at%5D%5Btype%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bstart%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bend%5D=&filter%5B_page%5D=1&filter%5B_sort_by%5D=uploaded_at&filter%5B_sort_order%5D=DESC&filter%5B_per_page%5D=32" Then I should see the table with all projects in the following order: | Uploaded At | Name | User | Flavor | Views | Downloads | private | Approved | Visible | Action | - | April 2, 2019 13:00 | program 2 | Karim | luna | 921 | 123 | no | no | yes | Show | - And I should not see "program 1" - And I should not see "program 5" - And I should not see "program 4" - And I should not see "program 3" + | April 2, 2019 13:00 | project 2 | Karim | luna | 921 | 123 | no | no | yes | Show | + And I should not see "project 1" + And I should not see "project 5" + And I should not see "project 4" + And I should not see "project 3" Scenario: Filter projects by username using filter options @@ -110,11 +110,11 @@ Feature: Admin all projects Then I am on "/admin/projects/list?filter%5Bid%5D%5Btype%5D=&filter%5Bid%5D%5Bvalue%5D=&filter%5Bname%5D%5Btype%5D=&filter%5Bname%5D%5Bvalue%5D=&filter%5Buser__username%5D%5Btype%5D=&filter%5Buser__username%5D%5Bvalue%5D=Karim&filter%5Buploaded_at%5D%5Btype%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bstart%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bend%5D=&filter%5B_page%5D=1&filter%5B_sort_by%5D=uploaded_at&filter%5B_sort_order%5D=DESC&filter%5B_per_page%5D=32" Then I should see the table with all projects in the following order: | Uploaded At | Name | User | Flavor | Views | Downloads | private | Approved | Visible | Action | - | April 22, 2019 13:00 | program 5 | Karim | pocketcode | 15 | 111 | no | no | no | Show | - | April 2, 2019 13:00 | program 2 | Karim | luna | 921 | 123 | no | no | yes | Show | - | January 1, 2019 12:00 | program 1 | Karim | pocketcode | 120 | 3 | no | no | yes | Show | - And I should not see "program 3" - And I should not see "program 4" + | April 22, 2019 13:00 | project 5 | Karim | pocketcode | 15 | 111 | no | no | no | Show | + | April 2, 2019 13:00 | project 2 | Karim | luna | 921 | 123 | no | no | yes | Show | + | January 1, 2019 12:00 | project 1 | Karim | pocketcode | 120 | 3 | no | no | yes | Show | + And I should not see "project 3" + And I should not see "project 4" Scenario: Filter projects by id using filter options @@ -124,11 +124,11 @@ Feature: Admin all projects Then I am on "/admin/projects/list?filter%5Bid%5D%5Btype%5D=&filter%5Bid%5D%5Bvalue%5D=4&filter%5Bname%5D%5Btype%5D=&filter%5Bname%5D%5Bvalue%5D=&filter%5Buser__username%5D%5Btype%5D=&filter%5Buser__username%5D%5Bvalue%5D=&filter%5Buploaded_at%5D%5Btype%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bstart%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bend%5D=&filter%5B_page%5D=1&filter%5B_sort_by%5D=uploaded_at&filter%5B_sort_order%5D=DESC&filter%5B_per_page%5D=32" Then I should see the table with all projects in the following order: | Uploaded At | Name | User | Flavor | Views | Downloads | private | Approved | Visible | Action | - | April 2, 2019 13:10 | program 4 | Pauli | pocketcode | 12 | 222 | no | no | no | Show | - And I should not see "program 1" - And I should not see "program 2" - And I should not see "program 3" - And I should not see "program 5" + | April 2, 2019 13:10 | project 4 | Pauli | pocketcode | 12 | 222 | no | no | no | Show | + And I should not see "project 1" + And I should not see "project 2" + And I should not see "project 3" + And I should not see "project 5" Scenario: Filter projects by flavor using filter options Given I log in as "Admin" with the password "123456" @@ -137,11 +137,11 @@ Feature: Admin all projects Then I am on "/admin/projects/list?filter%5Bid%5D%5Btype%5D=&filter%5Bid%5D%5Bvalue%5D=&filter%5Bname%5D%5Btype%5D=&filter%5Bname%5D%5Bvalue%5D=&filter%5Buser__username%5D%5Btype%5D=&filter%5Buser__username%5D%5Bvalue%5D=&filter%5Buploaded_at%5D%5Btype%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bstart%5D=&filter%5Buploaded_at%5D%5Bvalue%5D%5Bend%5D=&filter%5Bflavor%5D%5Btype%5D=&filter%5Bflavor%5D%5Bvalue%5D=luna&filter%5B_page%5D=1&filter%5B_sort_by%5D=uploaded_at&filter%5B_sort_order%5D=DESC&filter%5B_per_page%5D=32" Then I should see the table with all projects in the following order: | Uploaded At | Name | User | Flavor | Views | Downloads | private | Approved | Visible | Action | - | April 2, 2019 13:00 | program 2 | Karim | luna | 921 | 123 | no | no | yes | Show | - And I should not see "program 1" - And I should not see "program 3" - And I should not see "program 4" - And I should not see "program 5" + | April 2, 2019 13:00 | project 2 | Karim | luna | 921 | 123 | no | no | yes | Show | + And I should not see "project 1" + And I should not see "project 3" + And I should not see "project 4" + And I should not see "project 5" Scenario: Admin should be able to change the flavor of the project @@ -152,11 +152,11 @@ Feature: Admin all projects And I reload the page Then I should see the table with all projects in the following order: | Uploaded At | Name | User | Flavor | Views | Downloads | private | Approved | Visible | Action | - | April 22, 2019 13:00 | program 5 | Karim | pocketcode | 15 | 111 | no | no | no | Show | - | April 6, 2019 13:02 | program 3 | Pauli | arduino | 122 | 234 | no | no | no | Show | - | April 2, 2019 13:10 | program 4 | Pauli | pocketcode | 12 | 222 | no | no | no | Show | - | April 2, 2019 13:00 | program 2 | Karim | arduino | 921 | 123 | no | no | yes | Show | - | January 1, 2019 12:00 | program 1 | Karim | pocketcode | 120 | 3 | no | no | yes | Show | + | April 22, 2019 13:00 | project 5 | Karim | pocketcode | 15 | 111 | no | no | no | Show | + | April 6, 2019 13:02 | project 3 | Pauli | arduino | 122 | 234 | no | no | no | Show | + | April 2, 2019 13:10 | project 4 | Pauli | pocketcode | 12 | 222 | no | no | no | Show | + | April 2, 2019 13:00 | project 2 | Karim | arduino | 921 | 123 | no | no | yes | Show | + | January 1, 2019 12:00 | project 1 | Karim | pocketcode | 120 | 3 | no | no | yes | Show | # # TODO: Report project feature currently disabled @@ -165,22 +165,22 @@ Feature: Admin all projects # Given I am on "/admin/projects/list" # And I wait for the page to be loaded # And I change the approval of the project number "4" in the list to "yes" -# And I report project 2 with category "spam" and note "Bad Program" in Browser +# And I report project 2 with category "spam" and note "Bad Project" in Browser # And I am on "/app" # And I wait for the page to be loaded -# Then I should see "program 2" +# Then I should see "project 2" - Scenario: Change the visibility of the program + Scenario: Change the visibility of the project Given I log in as "Admin" with the password "123456" And I am on "/app" And I wait for the page to be loaded - Then I should not see "program 3" + Then I should not see "project 3" And I am on "/admin/projects/list" And I wait for the page to be loaded And I change the visibility of the project number "2" in the list to "yes" Then I am on "/app" And I wait for the page to be loaded - Then I should see "program 3" + Then I should see "project 3" Scenario: Click on the username should take me to the page where I can edit user info Given I log in as "Admin" with the password "123456" @@ -191,13 +191,13 @@ Feature: Admin all projects And I should see "Pauli" And I should see "Email" - Scenario: Clicking on the show button should take me to the page with program details + Scenario: Clicking on the show button should take me to the page with project details Given I log in as "Admin" with the password "123456" Given I am on "/admin/projects/list" And I wait for the page to be loaded And I click on the show button of the project number "3" in the list Then I should be on "/admin/approve/4/show" - And I should see "program 4" + And I should see "project 4" And I should see "abcdef" And I should see "Pauli" And I should see "Images" @@ -209,11 +209,11 @@ Feature: Admin all projects Given I log in as "Admin" with the password "123456" Given I am on "/admin/projects/list" And I wait for the page to be loaded - And I click on the project name "program 5" + And I click on the project name "project 5" And I wait for the page to be loaded Then I should be on "/admin/projects/5/show" And I should see "Projects Overview" - And I should see "program 5" + And I should see "project 5" And I should see "User" And I should see "Karim" And I should see "Update" diff --git a/tests/BehatFeatures/web/admin/reported_projects.feature.disable b/tests/BehatFeatures/web/admin/reported_projects.feature.disable index 1638818f90..28b93b00f4 100644 --- a/tests/BehatFeatures/web/admin/reported_projects.feature.disable +++ b/tests/BehatFeatures/web/admin/reported_projects.feature.disable @@ -1,7 +1,7 @@ # TODO: Report project feature currently disabled @admin -Feature: Admin reported programs - It should be possible to list all reported programs, unreport them and edit their visible status +Feature: Admin reported projects + It should be possible to list all reported projects, unreport them and edit their visible status Background: Given there are admins: @@ -13,44 +13,44 @@ Feature: Admin reported programs | Gregor | 123456 | dddddddddd | dev2@pocketcode.org | 3 | And there are projects: | id | name | description | visible | owned by | - | 1 | program 1 | my superman description | true | Gregor | - | 2 | program 2 | abcef | true | Superman | - | 3 | program 3 | hello | true | Gregor | + | 1 | project 1 | my superman description | true | Gregor | + | 2 | project 2 | abcef | true | Superman | + | 3 | project 3 | hello | true | Gregor | - Scenario: List reported programs sorted by date descending + Scenario: List reported projects sorted by date descending Given I log in as "Admin" with the password "123456" - And I report project 1 with category "spam" and note "Bad Program" in Browser - And I report project 2 with category "spam" and note "Even Worse Program" in Browser + And I report project 1 with category "spam" and note "Bad Project" in Browser + And I report project 2 with category "spam" and note "Even Worse Project" in Browser And I am on "/admin/reported_projects/list" And I wait for the page to be loaded Then I should see the reported projects table: | Note | State | Category | Reporting User | Project | Project Visible | - | Even Worse Program | New | Spam | Admin | program 2 | no | - | Bad Program | New | Spam | Admin | program 1 | no | + | Even Worse Project | New | Spam | Admin | project 2 | no | + | Bad Project | New | Spam | Admin | project 1 | no | - Scenario: Report another program and list should still be sorted by date descending + Scenario: Report another project and list should still be sorted by date descending Given I log in as "Admin" with the password "123456" - And I report project 1 with category "spam" and note "Bad Program" in Browser - And I report project 2 with category "spam" and note "Even Worse Program" in Browser + And I report project 1 with category "spam" and note "Bad Project" in Browser + And I report project 2 with category "spam" and note "Even Worse Project" in Browser And I am on "/admin/reported_projects/list" And I wait for the page to be loaded Then I should see the reported projects table: | Note | State | Category | Reporting User | Project | Project Visible | - | Even Worse Program | New | Spam | Admin | program 2 | no | - | Bad Program | New | Spam | Admin | program 1 | no | + | Even Worse Project | New | Spam | Admin | project 2 | no | + | Bad Project | New | Spam | Admin | project 1 | no | Then I report project 3 with category "dislike" and note "Pure Filth" in Browser And I am on "/admin/reported_projects/list" And I wait for the page to be loaded Then I should see the reported projects table: | Note | State | Category | Reporting User | Project | Project Visible | - | Pure Filth | New | Dislike | Admin | program 3 | no | - | Even Worse Program | New | Spam | Admin | program 2 | no | - | Bad Program | New | Spam | Admin | program 1 | no | + | Pure Filth | New | Dislike | Admin | project 3 | no | + | Even Worse Project | New | Spam | Admin | project 2 | no | + | Bad Project | New | Spam | Admin | project 1 | no | Scenario: Unreport project Given I log in as "Admin" with the password "123456" - And I report project 1 with category "spam" and note "Bad Program" in Browser - And I report project 2 with category "spam" and note "Even Worse Program" in Browser + And I report project 1 with category "spam" and note "Bad Project" in Browser + And I report project 2 with category "spam" and note "Even Worse Project" in Browser And I am on "/admin/reported_projects/list" And I wait for the page to be loaded And I am on "/admin/reported_projects/unreportProgram?id=2" @@ -59,99 +59,99 @@ Feature: Admin reported programs And I wait for the page to be loaded Then I should see the reported projects table: | Note | State | Category | Reporting User | Project | Project Visible | - | Bad Program | New | Spam | Admin | program 1 | no | + | Bad Project | New | Spam | Admin | project 1 | no | Scenario: Accept report of project with state filter Given I log in as "Admin" with the password "123456" - And I report project 1 with category "spam" and note "Bad Program" in Browser - And I report project 2 with category "spam" and note "Even Worse Program" in Browser + And I report project 1 with category "spam" and note "Bad Project" in Browser + And I report project 2 with category "spam" and note "Even Worse Project" in Browser And I am on "/admin/reported_projects/list" And I wait for the page to be loaded Then I am on "/admin/reported_projects/acceptProgramReport?id=2" And I wait for the page to be loaded Then I should see the reported projects table: | Note | State | Category | Reporting User | Project | Project Visible | - | Even Worse Program | Accepted | Spam | Admin | program 2 | no | - | Bad Program | New | Spam | Admin | program 1 | no | + | Even Worse Project | Accepted | Spam | Admin | project 2 | no | + | Bad Project | New | Spam | Admin | project 1 | no | Then I am on "/admin/reported_projects/list?filter%5Btime%5D%5Btype%5D=&filter%5Btime%5D%5Bvalue%5D%5Bstart%5D=&filter%5Btime%5D%5Bvalue%5D%5Bend%5D=&filter%5Bstate%5D%5Btype%5D=&filter%5Bstate%5D%5Bvalue%5D=2&filter%5Bcategory%5D%5Btype%5D=&filter%5Bcategory%5D%5Bvalue%5D=&filter%5BreportingUser__username%5D%5Btype%5D=&filter%5BreportingUser__username%5D%5Bvalue%5D=&filter%5Bprogram__visible%5D%5Btype%5D=&filter%5Bprogram__visible%5D%5Bvalue%5D=&filter%5B_page%5D=1&filter%5B_sort_by%5D=id&filter%5B_sort_order%5D=DESC&filter%5B_per_page%5D=32" And I wait for the page to be loaded | Note | State | Category | Reporting User | Project | Project Visible | - | Even Worse Program | Accepted | Spam | Admin | program 2 | no | - And I should not see "Bad Program" + | Even Worse Project | Accepted | Spam | Admin | project 2 | no | + And I should not see "Bad Project" Then I am on "/app" And I wait for the page to be loaded - And I should not see "program 1" - And I should not see "program 2" + And I should not see "project 1" + And I should not see "project 2" Scenario: Decline report of project with state filter Given I log in as "Admin" with the password "123456" - And I report project 1 with category "spam" and note "Bad Program" in Browser - And I report project 2 with category "spam" and note "Even Worse Program" in Browser + And I report project 1 with category "spam" and note "Bad Project" in Browser + And I report project 2 with category "spam" and note "Even Worse Project" in Browser And I am on "/admin/reported_projects/list" And I wait for the page to be loaded Then I am on "/admin/reported_projects/unreportProgram?id=2" And I wait for the page to be loaded Then I should see the reported projects table: | Note | State | Category | Reporting User | Project | Project Visible | - | Even Worse Program | Rejected | Spam | Admin | program 2 | yes | - | Bad Program | New | Spam | Admin | program 1 | no | + | Even Worse Project | Rejected | Spam | Admin | project 2 | yes | + | Bad Project | New | Spam | Admin | project 1 | no | Then I am on "/admin/reported_projects/list?filter%5Btime%5D%5Btype%5D=&filter%5Btime%5D%5Bvalue%5D%5Bstart%5D=&filter%5Btime%5D%5Bvalue%5D%5Bend%5D=&filter%5Bstate%5D%5Btype%5D=&filter%5Bstate%5D%5Bvalue%5D=3&filter%5Bcategory%5D%5Btype%5D=&filter%5Bcategory%5D%5Bvalue%5D=&filter%5BreportingUser__username%5D%5Btype%5D=&filter%5BreportingUser__username%5D%5Bvalue%5D=&filter%5Bprogram__visible%5D%5Btype%5D=&filter%5Bprogram__visible%5D%5Bvalue%5D=&filter%5B_page%5D=1&filter%5B_sort_by%5D=id&filter%5B_sort_order%5D=DESC&filter%5B_per_page%5D=32" And I wait for the page to be loaded | Note | State | Category | Reporting User | Project | Project Visible | - | Even Worse Program | Rejected | Spam | Admin | program 2 | yes | - And I should not see "Bad Program" + | Even Worse Project | Rejected | Spam | Admin | project 2 | yes | + And I should not see "Bad Project" Then I am on "/app" And I wait for the page to be loaded - And I should not see "program 1" - And I should see "program 2" + And I should not see "project 1" + And I should see "project 2" Scenario: Category filter Given I log in as "Admin" with the password "123456" - And I report project 1 with category "spam" and note "Bad Program" in Browser - And I report project 2 with category "dislike" and note "Even Worse Program" in Browser + And I report project 1 with category "spam" and note "Bad Project" in Browser + And I report project 2 with category "dislike" and note "Even Worse Project" in Browser Then I am on "/admin/reported_projects/list?filter%5Btime%5D%5Btype%5D=&filter%5Btime%5D%5Bvalue%5D%5Bstart%5D=&filter%5Btime%5D%5Bvalue%5D%5Bend%5D=&filter%5Bstate%5D%5Btype%5D=&filter%5Bstate%5D%5Bvalue%5D=&filter%5Bcategory%5D%5Btype%5D=&filter%5Bcategory%5D%5Bvalue%5D=Spam&filter%5BreportingUser__username%5D%5Btype%5D=&filter%5BreportingUser__username%5D%5Bvalue%5D=&filter%5Bprogram__visible%5D%5Btype%5D=&filter%5Bprogram__visible%5D%5Bvalue%5D=&filter%5B_page%5D=1&filter%5B_sort_by%5D=id&filter%5B_sort_order%5D=DESC&filter%5B_per_page%5D=32" And I wait for the page to be loaded Then I should see the reported projects table: | Note | State | Category | Reporting User | Project | Project Visible | - | Bad Program | New | Spam | Admin | program 1 | no | + | Bad Project | New | Spam | Admin | project 1 | no | And I should not see "dislike" Scenario: Visible filter Given I log in as "Admin" with the password "123456" - And I report project 1 with category "spam" and note "Bad Program" in Browser - And I report project 2 with category "dislike" and note "Even Worse Program" in Browser + And I report project 1 with category "spam" and note "Bad Project" in Browser + And I report project 2 with category "dislike" and note "Even Worse Project" in Browser Then I am on "/admin/reported_projects/unreportProgram?id=2" And I wait for the page to be loaded Then I am on "/admin/reported_projects/list?filter%5Btime%5D%5Btype%5D=&filter%5Btime%5D%5Bvalue%5D%5Bstart%5D=&filter%5Btime%5D%5Bvalue%5D%5Bend%5D=&filter%5Bstate%5D%5Btype%5D=&filter%5Bstate%5D%5Bvalue%5D=&filter%5Bcategory%5D%5Btype%5D=&filter%5Bcategory%5D%5Bvalue%5D=&filter%5BreportingUser__username%5D%5Btype%5D=&filter%5BreportingUser__username%5D%5Bvalue%5D=&filter%5Bprogram__visible%5D%5Btype%5D=&filter%5Bprogram__visible%5D%5Bvalue%5D=1&filter%5B_page%5D=1&filter%5B_sort_by%5D=id&filter%5B_sort_order%5D=DESC&filter%5B_per_page%5D=32" Then I should see the reported projects table: | Note | State | Category | Reporting User | Project | Project Visible | - | Even Worse Program | Rejected | Dislike | Admin | program 2 | yes | - And I should not see "Bad Program" + | Even Worse Project | Rejected | Dislike | Admin | project 2 | yes | + And I should not see "Bad Project" Scenario: Reporting User Username filter Given I log in as "Superman" with the password "123456" - And I report project 1 with category "spam" and note "Bad Program" in Browser + And I report project 1 with category "spam" and note "Bad Project" in Browser Then I logout And I log in as "Admin" with the password "123456" - And I report project 2 with category "spam" and note "Even Worse Program" in Browser + And I report project 2 with category "spam" and note "Even Worse Project" in Browser Then I am on "/admin/reported_projects/list?filter%5Btime%5D%5Btype%5D=&filter%5Btime%5D%5Bvalue%5D%5Bstart%5D=&filter%5Btime%5D%5Bvalue%5D%5Bend%5D=&filter%5Bstate%5D%5Btype%5D=&filter%5Bstate%5D%5Bvalue%5D=&filter%5Bcategory%5D%5Btype%5D=&filter%5Bcategory%5D%5Bvalue%5D=&filter%5BreportingUser__username%5D%5Btype%5D=&filter%5BreportingUser__username%5D%5Bvalue%5D=Admin&filter%5Bprogram__visible%5D%5Btype%5D=&filter%5Bprogram__visible%5D%5Bvalue%5D=&filter%5B_page%5D=1&filter%5B_sort_by%5D=id&filter%5B_sort_order%5D=DESC&filter%5B_per_page%5D=32" And I wait for the page to be loaded Then I should see the reported projects table: | Note | State | Category | Reporting User | Project | Project Visible | - | Even Worse Program | New | Spam | Admin | program 2 | no | + | Even Worse Project | New | Spam | Admin | project 2 | no | And I should see "Superman" And I should not see "Gregor" # Superman is shown Scenario: Reported User Username filter Given I log in as "Superman" with the password "123456" - And I report project 1 with category "spam" and note "Bad Program" in Browser + And I report project 1 with category "spam" and note "Bad Project" in Browser Then I logout And I log in as "Admin" with the password "123456" - And I report project 2 with category "spam" and note "Even Worse Program" in Browser + And I report project 2 with category "spam" and note "Even Worse Project" in Browser Then I am on "/admin/reported_projects/list?filter%5BreportedUser%5D%5Bvalue%5D=2" And I wait for the page to be loaded Then I should see the reported projects table: | Note | State | Category | Reported User | Reporting User | Project | Project Visible | - | Even Worse Program | New | Spam | Superman | Admin | program 2 | no | - And I should not see "Bad Program" \ No newline at end of file + | Even Worse Project | New | Spam | Superman | Admin | project 2 | no | + And I should not see "Bad Project" \ No newline at end of file diff --git a/tests/BehatFeatures/web/admin/reported_users.feature b/tests/BehatFeatures/web/admin/reported_users.feature index 47be0412a6..69365f8151 100644 --- a/tests/BehatFeatures/web/admin/reported_users.feature +++ b/tests/BehatFeatures/web/admin/reported_users.feature @@ -14,9 +14,9 @@ Feature: Admin reported users And there are projects: | id | name | description | owned by | downloads | apk_downloads | views | upload time | version | language version | visible | apk_ready | - | 1 | program 1 | my superman description | Superman | 3 | 2 | 12 | 01.01.2013 12:00 | 0.8.5 | 0.94 | true | true | - | 2 | program 2 | abcef | Gregor | 333 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | - | 3 | program 3 | abcef | Gregor | 333 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | + | 1 | project 1 | my superman description | Superman | 3 | 2 | 12 | 01.01.2013 12:00 | 0.8.5 | 0.94 | true | true | + | 2 | project 2 | abcef | Gregor | 333 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | + | 3 | project 3 | abcef | Gregor | 333 | 3 | 9 | 22.04.2014 13:00 | 0.8.5 | 0.93 | true | true | And there are comments: | project_id | user_id | upload_date | text | user_name | reported | | 2 | 2 | 01.01.2020 12:01 | c1 | Superman | 1 | @@ -45,7 +45,7 @@ Feature: Admin reported users And I should not see "Angel" @disabled - Scenario: List reported users sorted by reported programs + Scenario: List reported users sorted by reported projects Given I log in as "Adminius" with the password "123456" And I am on "/admin/reported_users/list?filter%5B_sort_order%5D=DESC&filter%5B_sort_by%5D=getProgramInappropriateReportsCount&filter%5B_page%5D=1&filter%5B_per_page%5D=32&_list_mode=list" And I wait for the page to be loaded @@ -55,7 +55,7 @@ Feature: Admin reported users And I should not see "Adminius" And I should not see "Superman" - Scenario: Show reported Programs by user + Scenario: Show reported Projects by user Given I log in as "Adminius" with the password "123456" And I am on "/admin/reported_users/list" And I wait for the page to be loaded @@ -67,7 +67,7 @@ Feature: Admin reported users And I wait for the page to be loaded Then I should be on "/admin/reported_projects/list?filter%5BreportedUser%5D%5Bvalue%5D=2" - Scenario: Show reported Programs by user + Scenario: Show reported Projects by user Given I log in as "Adminius" with the password "123456" And I am on "/admin/reported_users/list" And I wait for the page to be loaded diff --git a/tests/BehatFeatures/web/admin/server_maintenance.feature b/tests/BehatFeatures/web/admin/server_maintenance.feature index f55e1a4e67..adddf93f1a 100644 --- a/tests/BehatFeatures/web/admin/server_maintenance.feature +++ b/tests/BehatFeatures/web/admin/server_maintenance.feature @@ -24,7 +24,7 @@ Feature: Admin Server Maintenance Then the client response should contain "Generated APKs (0.00 B)" And there are projects: | id | name | apk_status | directory_hash | - | 1 | program 1 | ready | null | + | 1 | project 1 | ready | null | And there is a file "1.apk" with size "4096" bytes in the APK-folder When I GET "/admin/maintain/list" Then the client response should contain "Generated APKs (4.00 KiB)" @@ -32,12 +32,12 @@ Feature: Admin Server Maintenance Then the client response should contain "Generated APKs (0.00 B)" And project with id "1" should have no apk - Scenario: As a valid admin I want to be able to remove the compressed program files through the backend + Scenario: As a valid admin I want to be able to remove the compressed project files through the backend which should result in deleting resources from disk and reset entity state Given I am a logged in as super admin And there are projects: | id | name | apk_status | - | 1 | program | none | + | 1 | project | none | And there is a file "1.catrobat" with size "4096" bytes in the compressed-folder When I GET "/admin/maintain/list" Then the client response should contain "Compressed Catrobatfiles (4.00 KiB)" diff --git a/tests/BehatFeatures/web/admin/users_users.feature b/tests/BehatFeatures/web/admin/users_users.feature index 7e6f3dfcc3..20a564ebeb 100644 --- a/tests/BehatFeatures/web/admin/users_users.feature +++ b/tests/BehatFeatures/web/admin/users_users.feature @@ -1,5 +1,5 @@ @admin -Feature: Admin featured programs +Feature: Admin featured projects It should be possible to list all users, sort and filter etc. The created_at column does not work while creation of the users. They are updated afterwards. Background: diff --git a/tests/BehatFeatures/web/apk-generation/apk_download.feature b/tests/BehatFeatures/web/apk-generation/apk_download.feature index 1fb5027794..b43161dd11 100644 --- a/tests/BehatFeatures/web/apk-generation/apk_download.feature +++ b/tests/BehatFeatures/web/apk-generation/apk_download.feature @@ -4,7 +4,7 @@ Feature: Given there are projects: | name | apk_status | visible | id | | Galaxy War | none | true | 1 | - | My little program | pending | true | 2 | + | My little project | pending | true | 2 | | Bunny | ready | true | 3 | | Whack a Marko | ready | false | 4 | @@ -17,10 +17,10 @@ Feature: Then the apk file will not be found Scenario: - When I want to download the apk file of "My little program" + When I want to download the apk file of "My little project" Then the apk file will not be found - Scenario: I should not be allowed to download the apk of an invisible program + Scenario: I should not be allowed to download the apk of an invisible project When I want to download the apk file of "Whack a Marko" Then the apk file will not be found \ No newline at end of file diff --git a/tests/BehatFeatures/web/apk-generation/apk_generation.feature b/tests/BehatFeatures/web/apk-generation/apk_generation.feature index 8fa3f9e1f2..d1e1c62e56 100644 --- a/tests/BehatFeatures/web/apk-generation/apk_generation.feature +++ b/tests/BehatFeatures/web/apk-generation/apk_generation.feature @@ -5,7 +5,7 @@ Feature: And the token to upload an apk file is "UPLOADTOKEN" Scenario: Transmit data needed to build the apk to jenkins - Given I have a project "My little program" with id "1" + Given I have a project "My little project" with id "1" And the jenkins job id is "Build-Program" And the jenkins token is "SECRETTOKEN" When I start an apk generation of my project @@ -20,32 +20,32 @@ Feature: And the project apk status will be flagged "pending" Scenario: Accept the compiled apk from jenkins - Given I have a project "My little program" with id "1" + Given I have a project "My little project" with id "1" And I requested jenkins to build it When jenkins uploads the apk file to the given upload url Then it will be stored on the server And the project apk status will be flagged "ready" Scenario: Only build the apk once - Given I have a project "My little program" with id "1" + Given I have a project "My little project" with id "1" And the project apk status is flagged "pending" When I start an apk generation of my project Then no build request will be sent to jenkins Scenario: Reset flag if a build fails - Given I have a project "My little program" with id "1" + Given I have a project "My little project" with id "1" And the project apk status is flagged "pending" When I report a build error Then the project apk status will be flagged "none" Scenario: only reset flag if status is "pending" - Given I have a project "My little program" with id "1" + Given I have a project "My little project" with id "1" And the project apk status is flagged "ready" When I report a build error Then the project apk status will still be flagged "ready" Scenario: reset apk status after an update - Given I have a project "My little program" with id "1" + Given I have a project "My little project" with id "1" And the project apk status is flagged "ready" When I update this project Then the project apk status will still be flagged "none" diff --git a/tests/BehatFeatures/web/apk-generation/get_apk_status.feature b/tests/BehatFeatures/web/apk-generation/get_apk_status.feature index d0e3a213ed..3268f33aa9 100644 --- a/tests/BehatFeatures/web/apk-generation/get_apk_status.feature +++ b/tests/BehatFeatures/web/apk-generation/get_apk_status.feature @@ -1,7 +1,7 @@ -Feature: Get the APK status of a program +Feature: Get the APK status of a project Scenario: get the apk status pending - Given I have a project "My little program" with id "1" + Given I have a project "My little project" with id "1" And the project apk status is flagged "pending" When I GET "/app/ci/status/1" Then will get the following JSON: @@ -13,20 +13,20 @@ Feature: Get the APK status of a program """ Scenario: get the apk status ready - Given I have a project "My little program" with id "1" + Given I have a project "My little project" with id "1" And the project apk status is flagged "ready" When I GET "/app/ci/status/1" Then will get the following JSON: """ { "status" : "ready", - "url" : "http://localhost/app/ci/download/(.*)?fname=My%20little%20program", + "url" : "http://localhost/app/ci/download/(.*)?fname=My%20little%20project", "label" : "Download apk" } """ Scenario: get the apk status none - Given I have a project "My little program" with id "1" + Given I have a project "My little project" with id "1" And the project apk status is flagged "none" When I GET "/app/ci/status/1" Then will get the following JSON: diff --git a/tests/BehatFeatures/web/code-statistics/project_code_statistics.feature b/tests/BehatFeatures/web/code-statistics/project_code_statistics.feature index f93a6ccba5..b2083e8c90 100644 --- a/tests/BehatFeatures/web/code-statistics/project_code_statistics.feature +++ b/tests/BehatFeatures/web/code-statistics/project_code_statistics.feature @@ -4,7 +4,7 @@ Feature: As a visitor I want to see code statistics on the project page Scenario: For performance reasons the code statistics are on its own page Given there are projects: | id | name | - | 1 | program 1 | + | 1 | project 1 | And I am on "/app/project/1" And I wait for the page to be loaded And I click "#projectCodeStatsButton-small" @@ -15,7 +15,7 @@ Feature: As a visitor I want to see code statistics on the project page Scenario: Code statistics provide means to return to the project page Given there are projects: | id | name | - | 1 | program 1 | + | 1 | project 1 | And I am on "/app" And I wait for the page to be loaded When I go to "/app/project/1/code_statistics" @@ -26,7 +26,7 @@ Feature: As a visitor I want to see code statistics on the project page Scenario: Code statistics page title is no link Given there are projects: | id | name | - | 1 | program 1 | + | 1 | project 1 | And I am on "/app/project/1/code_statistics" And I click "#top-app-bar__title" Then I should be on "/app/project/1/code_statistics" diff --git a/tests/BehatFeatures/web/code-view/project_code_view.feature b/tests/BehatFeatures/web/code-view/project_code_view.feature index 7b4d619ea9..3c98585615 100644 --- a/tests/BehatFeatures/web/code-view/project_code_view.feature +++ b/tests/BehatFeatures/web/code-view/project_code_view.feature @@ -6,7 +6,7 @@ Feature: As a visitor I want to see the code view on a project page Scenario: For performance reasons the code view is on its own page Given there are projects: | id | name | - | 1 | program 1 | + | 1 | project 1 | And I am on "/app/project/1" And I wait for the page to be loaded And I click "#projectCodeViewButton-small" @@ -17,7 +17,7 @@ Feature: As a visitor I want to see the code view on a project page Scenario: Code view provide means to return to the project page Given there are projects: | id | name | - | 1 | program 1 | + | 1 | project 1 | And I am on "/app" When I go to "/app/project/1/code_view" And I click "#top-app-bar__back__btn-back" @@ -26,7 +26,7 @@ Feature: As a visitor I want to see the code view on a project page Scenario: Code view page title is no link Given there are projects: | id | name | - | 1 | program 1 | + | 1 | project 1 | And I am on "/app/project/1/code_view" And I click "#top-app-bar__title" Then I should be on "/app/project/1/code_view" diff --git a/tests/BehatFeatures/web/comments/project_comments.feature b/tests/BehatFeatures/web/comments/project_comments.feature index ed69998df5..9ded5351fb 100644 --- a/tests/BehatFeatures/web/comments/project_comments.feature +++ b/tests/BehatFeatures/web/comments/project_comments.feature @@ -36,7 +36,7 @@ Feature: As a visitor I want to write, see and report comments. # 3 has no comments - Scenario: There should be a commend section on every program page + Scenario: There should be a commend section on every project page Given I am on "/app/project/1" And I wait for the page to be loaded Then I should see "Comments" @@ -275,7 +275,7 @@ Feature: As a visitor I want to write, see and report comments. Then the element "#catro-notification-1" should be visible And I should see "OtherUser" - Scenario: I should be able to write a comment for my own program but I wont get a notification + Scenario: I should be able to write a comment for my own project but I wont get a notification Given I log in as "Catrobat" And I am on "/app/project/1" And I wait for the page to be loaded diff --git a/tests/BehatFeatures/web/general/homepage.feature b/tests/BehatFeatures/web/general/homepage.feature index 7d1f76e4cf..88514d2873 100644 --- a/tests/BehatFeatures/web/general/homepage.feature +++ b/tests/BehatFeatures/web/general/homepage.feature @@ -112,14 +112,14 @@ Feature: Pocketcode homepage And I wait for the page to be loaded And the element "#welcome-section" should not exist - Scenario: Featured Programs and Urls + Scenario: Featured Projects and Urls Given I am on homepage And I wait for the page to be loaded Then I should see the featured slider And I should see the slider with the values "http://www.google.at/,project 2,project 3" @disabled - Scenario: Example Programs + Scenario: Example Projects Given I am on homepage And I wait for the page to be loaded Then the element "#home-projects__example" should exist diff --git a/tests/BehatFeatures/web/general/language_switcher.feature b/tests/BehatFeatures/web/general/language_switcher.feature index eb214704c6..e7aeca8d8d 100644 --- a/tests/BehatFeatures/web/general/language_switcher.feature +++ b/tests/BehatFeatures/web/general/language_switcher.feature @@ -52,7 +52,7 @@ Feature: Users can choose between multiple languages. Text should be automatical Then one of the ".project-list__title" elements should contain "heruntergeladen" And the element "#home-projects__most_downloaded" should be visible - Scenario: User with selected russian language sees the remix graph button and details on program page + Scenario: User with selected russian language sees the remix graph button and details on project page Given there are forward remix relations: | ancestor_id | descendant_id | depth | | 1 | 1 | 0 | diff --git a/tests/BehatFeatures/web/media-library/mediapackage.feature b/tests/BehatFeatures/web/media-library/mediapackage.feature index 72a7d2bb10..e056b2a555 100644 --- a/tests/BehatFeatures/web/media-library/mediapackage.feature +++ b/tests/BehatFeatures/web/media-library/mediapackage.feature @@ -1,6 +1,6 @@ @homepage Feature: - In order to speed up the creation of a pocketcode program + In order to speed up the creation of a pocketcode project As UX/Design team We want to offer the user a library of assets to work with diff --git a/tests/BehatFeatures/web/notifications/notifications_tabs_for_types.feature b/tests/BehatFeatures/web/notifications/notifications_tabs_for_types.feature index 93a0c09245..c1a5771e8b 100644 --- a/tests/BehatFeatures/web/notifications/notifications_tabs_for_types.feature +++ b/tests/BehatFeatures/web/notifications/notifications_tabs_for_types.feature @@ -10,8 +10,8 @@ Feature: User gets notifications for new followers, reactions, comments, .. And there are projects: | id | name | owned by | - | 1 | program 1 | Catrobat | - | 2 | program 2 | User | + | 1 | project 1 | Catrobat | + | 2 | project 2 | User | Scenario: Notification page must have multiple tabs Given I log in as "Catrobat" @@ -45,50 +45,50 @@ Feature: User gets notifications for new followers, reactions, comments, .. Then I should see "It looks like you don't have any remix notifications." Scenario: Notifications tabs contain only notifications of their type - Given there are "1" "like" notifications for project "program 1" from "User" - And there are "1" "comment" notifications for project "program 1" from "User" - And there are "1" "remix" notifications for project "program 1" from "User" + Given there are "1" "like" notifications for project "project 1" from "User" + And there are "1" "comment" notifications for project "project 1" from "User" + And there are "1" "remix" notifications for project "project 1" from "User" And there is a notification that "User" follows "Catrobat" When I log in as "Catrobat" And I am on "/app/user_notifications" And I wait for the page to be loaded Then I should see "User is now following you." - And I should see "User created a remix program 1 of your game program 1." - And I should see "User commented on program 1." - And I should see "User reacted to program 1." + And I should see "User created a remix project 1 of your game project 1." + And I should see "User commented on project 1." + And I should see "User reacted to project 1." When I click "#reaction-notif" Then I should not see "User is now following you." - And I should not see "User created a remix program 1 of your game program 1." - And I should not see "User commented on program 1." - But I should see "User reacted to program 1." + And I should not see "User created a remix project 1 of your game project 1." + And I should not see "User commented on project 1." + But I should see "User reacted to project 1." When I click "#follow-notif" And I wait for the page to be loaded Then I should see "User is now following you." - But I should not see "User created a remix program 1 of your game program 1." - And I should not see "User commented on program 1." - And I should not see "User reacted to program 1." + But I should not see "User created a remix project 1 of your game project 1." + And I should not see "User commented on project 1." + And I should not see "User reacted to project 1." When I click "#comment-notif" And I wait for the page to be loaded Then I should not see "User is now following you." - And I should not see "User created a remix program 1 of your game program 1." - And I should not see "User reacted to program 1." - But I should see "User commented on program 1." + And I should not see "User created a remix project 1 of your game project 1." + And I should not see "User reacted to project 1." + But I should see "User commented on project 1." When I click "#remix-notif" And I wait for the page to be loaded - Then I should see "User created a remix program 1 of your game program 1." + Then I should see "User created a remix project 1 of your game project 1." But I should not see "User is now following you." - And I should not see "User commented on program 1." - And I should not see "User reacted to program 1." + And I should not see "User commented on project 1." + And I should not see "User reacted to project 1." When I click "#all-notif" And I wait for the page to be loaded Then I should see "User is now following you." - And I should see "User created a remix program 1 of your game program 1." - And I should see "User commented on program 1." - And I should see "User reacted to program 1." + And I should see "User created a remix project 1 of your game project 1." + And I should see "User commented on project 1." + And I should see "User reacted to project 1." diff --git a/tests/BehatFeatures/web/notifications/notifications_type_comment.feature b/tests/BehatFeatures/web/notifications/notifications_type_comment.feature index a6adc6fc2c..48da8a20ae 100644 --- a/tests/BehatFeatures/web/notifications/notifications_type_comment.feature +++ b/tests/BehatFeatures/web/notifications/notifications_type_comment.feature @@ -1,5 +1,5 @@ @web @notifications -Feature: User gets notifications about comments on their programs +Feature: User gets notifications about comments on their projects Background: Given there are users: @@ -8,7 +8,7 @@ Feature: User gets notifications about comments on their programs | User-id | User | And there are projects: | id | name | owned by | - | 1 | program 1 | Catrobat | + | 1 | project 1 | Catrobat | And there are comments: | id | project_id | user_id | text | | 1 | 1 | Catrobat-id | c1 | @@ -23,7 +23,7 @@ Feature: User gets notifications about comments on their programs Then I should see "User commented" When I click "#comment-notif" And I wait for AJAX to finish - Then I should see "User commented on program 1" + Then I should see "User commented on project 1" Scenario: Users should not be notified about their own comments Given there are catro notifications: diff --git a/tests/BehatFeatures/web/notifications/notifications_type_follower.feature b/tests/BehatFeatures/web/notifications/notifications_type_follower.feature index fb6c9ed911..bcf29ca3f1 100644 --- a/tests/BehatFeatures/web/notifications/notifications_type_follower.feature +++ b/tests/BehatFeatures/web/notifications/notifications_type_follower.feature @@ -1,5 +1,5 @@ @web @notifications -Feature: Follower and new programs of users you follow notifications +Feature: Follower and new projects of users you follow notifications Background: Given there are users: @@ -8,7 +8,7 @@ Feature: Follower and new programs of users you follow notifications | User-id | User | And there are projects: | id | name | owned by | - | 1 | program 1 | Catrobat | + | 1 | project 1 | Catrobat | Scenario: Uses should not be notified about follows under follower category Given there is a notification that "User" follows "Catrobat" @@ -38,7 +38,7 @@ Feature: Follower and new programs of users you follow notifications Then I should be on "/app/follower" - Scenario: User should get new program notifications from users they are following under follower category + Scenario: User should get new project notifications from users they are following under follower category Given User "Catrobat-id" is followed by user "User-id" And there is a project with "url" set to "/app/project/1" And user "User" uploads a valid Catrobat project, API version 2 @@ -49,7 +49,7 @@ Feature: Follower and new programs of users you follow notifications And I wait for AJAX to finish Then I should see "User created a new game" - Scenario: Clicking on a new program notification should redirect the user to the program page + Scenario: Clicking on a new project notification should redirect the user to the project page Given there are catro notifications: | id | user | type | follower_id | project_id | | 1 | User | follow_project | | 1 | diff --git a/tests/BehatFeatures/web/notifications/notifications_type_reaction.feature b/tests/BehatFeatures/web/notifications/notifications_type_reaction.feature index 2da3816196..fe7dfe774b 100644 --- a/tests/BehatFeatures/web/notifications/notifications_type_reaction.feature +++ b/tests/BehatFeatures/web/notifications/notifications_type_reaction.feature @@ -9,8 +9,8 @@ Feature: User gets notifications for new followers, reactions, comments, .. | User-id | User | And there are projects: | id | name | owned by | - | 1 | program 1 | Catrobat | - | 2 | program 2 | User | + | 1 | project 1 | Catrobat | + | 2 | project 2 | User | Scenario: Users should be notified about reactions Given there are catro notifications: diff --git a/tests/BehatFeatures/web/profile/profile_edit.feature b/tests/BehatFeatures/web/profile/profile_edit.feature index a0c9b2fcb0..bfe1756b45 100644 --- a/tests/BehatFeatures/web/profile/profile_edit.feature +++ b/tests/BehatFeatures/web/profile/profile_edit.feature @@ -2,7 +2,7 @@ Feature: In order to manage the my profile page As a logged in user - I want to be able to change my password, email and upload an avatar image and delete my own programs + I want to be able to change my password, email and upload an avatar image and delete my own projects Background: Given there are users: @@ -286,7 +286,7 @@ Feature: And I wait for the element ".own-project-list__project[data-id='2'] .loading-spinner-backdrop" to appear and if so to disappear again Then the ".own-project-list__project[data-id='2'] .own-project-list__project__details__visibility__text" element should contain "public" - Scenario: Programs with too high language version can also be set to visible + Scenario: Projects with too high language version can also be set to visible Then I should see "project 2" And the ".own-project-list__project[data-id='2'] .own-project-list__project__details__visibility__text" element should contain "private" When I click ".own-project-list__project[data-id='2'] .own-project-list__project__action" diff --git a/tests/BehatFeatures/web/profile/profile_image.feature b/tests/BehatFeatures/web/profile/profile_image.feature index 684e3cd26b..fec1cfefdb 100644 --- a/tests/BehatFeatures/web/profile/profile_image.feature +++ b/tests/BehatFeatures/web/profile/profile_image.feature @@ -2,7 +2,7 @@ Feature: In order to manage the my profile page As a logged in user - I want to be able to change my password, email, and upload an avatar image and delete my own programs + I want to be able to change my password, email, and upload an avatar image and delete my own projects Background: Given there are users: diff --git a/tests/BehatFeatures/web/project/project_debug_build.feature b/tests/BehatFeatures/web/project/project_debug_build.feature index 35c923867e..8eeaebf32e 100644 --- a/tests/BehatFeatures/web/project/project_debug_build.feature +++ b/tests/BehatFeatures/web/project/project_debug_build.feature @@ -7,75 +7,75 @@ Feature: Using a release app I should not see debug projects | 1 | Catrobat | And there are projects: | id | name | owned by | downloads | views | upload time | version | debug | - | 1 | program 1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.9.10 | false | - | 2 | program 2 | Catrobat | 333 | 9 | 22.04.2014 13:00 | 0.9.10 | false | - | 3 | debug program | Catrobat | 450 | 80 | 01.04.2019 09:00 | 1.0.12 | true | - | 4 | program 4 | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.9.10 | false | + | 1 | project 1 | Catrobat | 3 | 12 | 01.01.2013 12:00 | 0.9.10 | false | + | 2 | project 2 | Catrobat | 333 | 9 | 22.04.2014 13:00 | 0.9.10 | false | + | 3 | debug project | Catrobat | 450 | 80 | 01.04.2019 09:00 | 1.0.12 | true | + | 4 | project 4 | Catrobat | 133 | 33 | 01.01.2012 13:00 | 0.9.10 | false | Scenario: Viewing homepage with debug app Given I use a debug build of the Catroid app And I am on homepage And I wait for the page to be loaded - Then one of the "#home-projects__recent .project-list__project__name" elements should contain "program 1" - Then one of the "#home-projects__recent .project-list__project__name" elements should contain "program 2" - Then one of the "#home-projects__recent .project-list__project__name" elements should contain "debug program" - Then one of the "#home-projects__recent .project-list__project__name" elements should contain "program 4" - Then one of the "#home-projects__most_downloaded .project-list__project__name" elements should contain "program 1" - Then one of the "#home-projects__most_downloaded .project-list__project__name" elements should contain "program 2" - Then one of the "#home-projects__most_downloaded .project-list__project__name" elements should contain "debug program" - Then one of the "#home-projects__most_downloaded .project-list__project__name" elements should contain "program 4" - Then one of the "#home-projects__random .project-list__project__name" elements should contain "program 1" - Then one of the "#home-projects__random .project-list__project__name" elements should contain "program 2" - Then one of the "#home-projects__random .project-list__project__name" elements should contain "debug program" - Then one of the "#home-projects__random .project-list__project__name" elements should contain "program 4" + Then one of the "#home-projects__recent .project-list__project__name" elements should contain "project 1" + Then one of the "#home-projects__recent .project-list__project__name" elements should contain "project 2" + Then one of the "#home-projects__recent .project-list__project__name" elements should contain "debug project" + Then one of the "#home-projects__recent .project-list__project__name" elements should contain "project 4" + Then one of the "#home-projects__most_downloaded .project-list__project__name" elements should contain "project 1" + Then one of the "#home-projects__most_downloaded .project-list__project__name" elements should contain "project 2" + Then one of the "#home-projects__most_downloaded .project-list__project__name" elements should contain "debug project" + Then one of the "#home-projects__most_downloaded .project-list__project__name" elements should contain "project 4" + Then one of the "#home-projects__random .project-list__project__name" elements should contain "project 1" + Then one of the "#home-projects__random .project-list__project__name" elements should contain "project 2" + Then one of the "#home-projects__random .project-list__project__name" elements should contain "debug project" + Then one of the "#home-projects__random .project-list__project__name" elements should contain "project 4" Scenario: Viewing homepage with release app Given I use a release build of the Catroid app And I am on homepage And I wait for the page to be loaded - Then one of the "#home-projects__recent .project-list__project__name" elements should contain "program 1" - Then one of the "#home-projects__recent .project-list__project__name" elements should contain "program 2" - Then none of the "#home-projects__recent .project-list__project__name" elements should contain "debug program" - Then one of the "#home-projects__recent .project-list__project__name" elements should contain "program 4" - Then one of the "#home-projects__most_downloaded .project-list__project__name" elements should contain "program 1" - Then one of the "#home-projects__most_downloaded .project-list__project__name" elements should contain "program 2" - Then none of the "#home-projects__most_downloaded .project-list__project__name" elements should contain "debug program" - Then one of the "#home-projects__most_downloaded .project-list__project__name" elements should contain "program 4" - Then one of the "#home-projects__random .project-list__project__name" elements should contain "program 1" - Then one of the "#home-projects__random .project-list__project__name" elements should contain "program 2" - Then none of the "#home-projects__random .project-list__project__name" elements should contain "debug program" - Then one of the "#home-projects__random .project-list__project__name" elements should contain "program 4" + Then one of the "#home-projects__recent .project-list__project__name" elements should contain "project 1" + Then one of the "#home-projects__recent .project-list__project__name" elements should contain "project 2" + Then none of the "#home-projects__recent .project-list__project__name" elements should contain "debug project" + Then one of the "#home-projects__recent .project-list__project__name" elements should contain "project 4" + Then one of the "#home-projects__most_downloaded .project-list__project__name" elements should contain "project 1" + Then one of the "#home-projects__most_downloaded .project-list__project__name" elements should contain "project 2" + Then none of the "#home-projects__most_downloaded .project-list__project__name" elements should contain "debug project" + Then one of the "#home-projects__most_downloaded .project-list__project__name" elements should contain "project 4" + Then one of the "#home-projects__random .project-list__project__name" elements should contain "project 1" + Then one of the "#home-projects__random .project-list__project__name" elements should contain "project 2" + Then none of the "#home-projects__random .project-list__project__name" elements should contain "debug project" + Then one of the "#home-projects__random .project-list__project__name" elements should contain "project 4" Scenario: Viewing profile with debug app Given I use a debug build of the Catroid app And I log in as "Catrobat" with the password "123456" And I am on "/app/user" And I wait for the page to be loaded - Then I should see "program 1" - And I should see "program 2" - And I should see "debug program" - And I should see "program 4" + Then I should see "project 1" + And I should see "project 2" + And I should see "debug project" + And I should see "project 4" Scenario: Viewing profile with release app Given I use a release build of the Catroid app And I log in as "Catrobat" with the password "123456" And I am on "/app/user" And I wait for the page to be loaded - Then I should see "program 1" - And I should see "program 2" + Then I should see "project 1" + And I should see "project 2" # In new API, debug projects are only visible using debug app - And I should not see "debug program" - And I should see "program 4" + And I should not see "debug project" + And I should see "project 4" - Scenario: Viewing program marked as debug using debug app + Scenario: Viewing project marked as debug using debug app Given I use a debug build of the Catroid app And I am on "/app/project/3" And I wait for the page to be loaded - And I should see "debug program" + And I should see "debug project" - Scenario: Viewing program marked as debug using release app + Scenario: Viewing project marked as debug using release app Given I use a release build of the Catroid app And I am on "/app/project/3" And I wait for the page to be loaded - And I should not see "debug program" + And I should not see "debug project" And I should be on "/app/" diff --git a/tests/BehatFeatures/web/project/project_private.feature b/tests/BehatFeatures/web/project/project_private.feature index 001eafac25..7568aee1aa 100644 --- a/tests/BehatFeatures/web/project/project_private.feature +++ b/tests/BehatFeatures/web/project/project_private.feature @@ -1,5 +1,5 @@ @homepage -Feature: As a visitor I want to see a program page +Feature: As a visitor I want to see a project page Background: Given there are users: diff --git a/tests/BehatFeatures/web/remix-system/project_remixes.feature b/tests/BehatFeatures/web/remix-system/project_remixes.feature index 0f2b7f6ea5..49f1022139 100644 --- a/tests/BehatFeatures/web/remix-system/project_remixes.feature +++ b/tests/BehatFeatures/web/remix-system/project_remixes.feature @@ -1,5 +1,5 @@ @homepage @remixgraph -Feature: As a visitor I want to see the full remix graph of a program on the program page +Feature: As a visitor I want to see the full remix graph of a project on the project page Background: Given there are users: diff --git a/tests/BehatFeatures/web/scratch-integration/project_scratch.feature b/tests/BehatFeatures/web/scratch-integration/project_scratch.feature index f91329072d..f517fad9d6 100644 --- a/tests/BehatFeatures/web/scratch-integration/project_scratch.feature +++ b/tests/BehatFeatures/web/scratch-integration/project_scratch.feature @@ -2,19 +2,19 @@ Feature: As a visitor I want to see scratch projects - Scenario: Visit a Scratch program + Scenario: Visit a Scratch project Given I request "GET" "/app/scratch/project/401650420" Then I should be redirected to a catrobat project And there should be "1" projects in the database And there should be "1" users in the database - Scenario: Visiting a not existing Scratch program + Scenario: Visiting a not existing Scratch project Given I am on "/app/scratch/project/1" Then I should be on "/app/" And there should be "0" projects in the database And there should be "0" users in the database - Scenario: Visiting a Scratch program twice + Scenario: Visiting a Scratch project twice Given I request "GET" "/app/scratch/project/401650420" Then I should be redirected to a catrobat project And I request "GET" "/app/scratch/project/401650420" @@ -22,7 +22,7 @@ Feature: As a visitor I want to see scratch projects And there should be "1" projects in the database And there should be "1" users in the database - Scenario: Visiting two Scratch programs made by the same user + Scenario: Visiting two Scratch projects made by the same user Given I request "GET" "/app/scratch/project/401650420" Then I should be redirected to a catrobat project And I request "GET" "/app/scratch/project/398466654" diff --git a/tests/BehatFeatures/web/search/search.feature b/tests/BehatFeatures/web/search/search.feature index 039aaff488..a2b8289700 100644 --- a/tests/BehatFeatures/web/search/search.feature +++ b/tests/BehatFeatures/web/search/search.feature @@ -1,5 +1,5 @@ @web @search -Feature: Searching for programs +Feature: Searching for projects Background: Given there are users: @@ -24,40 +24,40 @@ Feature: Searching for programs | story | __Geschichte | And there are projects: | id | name | description | owned by | tags | extensions | upload time | version | - | 1 | program 1 | p1 | User1 | game | arduino | 22.04.2014 12:00 | 0.8.5 | - | 2 | test program | | User2 | animation | arduino | 22.04.2014 13:00 | 0.8.5 | + | 1 | project 1 | p1 | User1 | game | arduino | 22.04.2014 12:00 | 0.8.5 | + | 2 | test project | | User2 | animation | arduino | 22.04.2014 13:00 | 0.8.5 | | 3 | Test advanced app | | Cat | story | drone | 22.04.2014 14:00 | 0.8.5 | - | 4 | Catrobat | my program | User1 | story | mindstorms | 22.04.2014 14:00 | 0.8.5 | - | 5 | project 3 | mindstorms | Cat | game, animation | phiro | 22.04.2014 14:00 | 0.8.5 | + | 4 | Catrobat | my project | User1 | story | mindstorms | 22.04.2014 14:00 | 0.8.5 | + | 5 | notAProject 3 | mindstorms | Cat | game, animation | phiro | 22.04.2014 14:00 | 0.8.5 | | 6 | test advanced games | | User3 | animation, story | mindstorms | 22.04.2014 14:00 | 0.8.5 | | 7 | test | | Cat | story, animation | mindstorms | 22.04.2014 14:00 | 0.8.5 | - | 8 | project test | catrobat | User1 | game | drone | 22.04.2014 14:00 | 0.8.5 | + | 8 | notAProject test | catrobat | User1 | game | drone | 22.04.2014 14:00 | 0.8.5 | And I wait 1000 milliseconds - Scenario: search for programs, which contain the word "program" - Given I am on "/app/search/program" + Scenario: search for projects, which contain the word "project" + Given I am on "/app/search/project" And I wait for the page to be loaded Then I should see "Search results" - Then I should see "program 1" - Then I should see "test program" + Then I should see "project 1" + Then I should see "test project" Then I should see "Catrobat" Then I should not see "Test advanced app" - Then I should not see "project 3" - Then I should not see "project test" + Then I should not see "notAProject 3" + Then I should not see "notAProject test" - Scenario: search for programs, which contain the word "Test" + Scenario: search for projects, which contain the word "Test" Given I am on "/app/search/Test" And I wait for the page to be loaded Then I should see "Search results" Then I should see "test advanced games" Then I should see "test advanced app" - Then I should see "test program" + Then I should see "test project" Then I should see "test" - Then I should see "project test" + Then I should see "notAProject test" Then I should see "testUser" - Scenario: search for programs, which contain the word "test advanced" + Scenario: search for projects, which contain the word "test advanced" Given I am on "/app/search/Test%20advanced" And I wait for the page to be loaded Then I should see "Search results" @@ -69,12 +69,12 @@ Feature: Searching for programs And I wait for the page to be loaded Then I should see "Search results" Then I should see "test advanced games" - Then I should see "program 1" - Then I should see "project 3" - Then I should see "project test" + Then I should see "project 1" + Then I should see "notAProject 3" + Then I should see "notAProject test" - Scenario: search for projects, which contain the word "program and app" - Given I am on "/app/search/program%20and%20app" + Scenario: search for projects, which contain the word "project and app" + Given I am on "/app/search/project%20and%20app" And I wait for the page to be loaded Then I should see "Search results" @@ -84,17 +84,17 @@ Feature: Searching for programs Then I should see "Search results" Then I should see "Test advanced games" Then I should see "Catrobat" - Then I should see "project 3" + Then I should see "notAProject 3" Then I should see "test" - Scenario: search for gmail should find no program + Scenario: search for gmail should find no project Given I am on "/app/search/gmail" And I wait for the page to be loaded Then I should see "Search results" Then I should see "No projects found" Then I should see "No users found" - Scenario: search for gmx should find no program + Scenario: search for gmx should find no project Given I am on "/app/search/gmx.at" And I wait for the page to be loaded Then I should see "Search results" @@ -109,8 +109,8 @@ Feature: Searching for programs Then I should see "User1" Then I should see "User2" Then I should see "User3" - Then I should see "program 1" - Then I should see "test program" + Then I should see "project 1" + Then I should see "test project" Then I should see "Catrobat" Then I should see "test advanced games" Then I should see "project test" @@ -126,12 +126,12 @@ Feature: Searching for programs Then I should not see "User3" Then I should see "Catrobat" Then I should see "Test advanced app" - Then I should see "project 3" + Then I should see "notAProject 3" Then I should see "test" - Then I should not see "program 1" - Then I should not see "test program" + Then I should not see "project 1" + Then I should not see "test project" Then I should not see "test advanced games" - Then I should see "project test" + Then I should see "notAProject test" Scenario: search for projects, which contain the word "Story" diff --git a/tests/BehatFeatures/web/search/search_programs_via_extensions.feature b/tests/BehatFeatures/web/search/search_projects_via_extensions.feature similarity index 89% rename from tests/BehatFeatures/web/search/search_programs_via_extensions.feature rename to tests/BehatFeatures/web/search/search_projects_via_extensions.feature index b04ee25ec2..5a81656be6 100644 --- a/tests/BehatFeatures/web/search/search_programs_via_extensions.feature +++ b/tests/BehatFeatures/web/search/search_projects_via_extensions.feature @@ -1,5 +1,5 @@ @web @search -Feature: Searching for programs with extensions +Feature: Searching for projects with extensions Background: Given there are users: @@ -20,7 +20,7 @@ Feature: Searching for programs with extensions | 3 | project 3 | User1 | drone | And I wait 1000 milliseconds - Scenario: Searching other programs with the same extensions + Scenario: Searching other projects with the same extensions Given I am on "/app/project/1" And I wait for the page to be loaded And I should see "project 1" @@ -33,7 +33,7 @@ Feature: Searching for programs with extensions And I should see "project 2" And I should not see "project 3" - Scenario: search for programs should work + Scenario: search for projects should work When I am on "/app/search_old/mindstorms" And I wait for the page to be loaded Then I should see "Search results" diff --git a/tests/BehatFeatures/web/search/search_programs_via_projectowner.feature b/tests/BehatFeatures/web/search/search_projects_via_projectowner.feature similarity index 82% rename from tests/BehatFeatures/web/search/search_programs_via_projectowner.feature rename to tests/BehatFeatures/web/search/search_projects_via_projectowner.feature index fa0a4dce54..da5524bba5 100644 --- a/tests/BehatFeatures/web/search/search_programs_via_projectowner.feature +++ b/tests/BehatFeatures/web/search/search_projects_via_projectowner.feature @@ -1,5 +1,5 @@ @web @search -Feature: Searching for programs with ownername +Feature: Searching for projects with ownername Background: Given there are users: @@ -15,7 +15,7 @@ Feature: Searching for programs with ownername | 3 | project 3 | User3 | And I wait 1000 milliseconds - Scenario: search for programs with full name should work + Scenario: search for projects with full name should work When I am on "/app/search/User3" And I wait for the page to be loaded Then I should see "Search results" @@ -23,7 +23,7 @@ Feature: Searching for programs with ownername And I should not see "project 2" But I should see "project 3" - Scenario: search for programs with parts of name should work + Scenario: search for projects with parts of name should work When I am on "/app/search/User" And I wait for the page to be loaded Then I should see "Search results" diff --git a/tests/BehatFeatures/web/search/search_programs_via_tags.feature b/tests/BehatFeatures/web/search/search_projects_via_tags.feature similarity index 93% rename from tests/BehatFeatures/web/search/search_programs_via_tags.feature rename to tests/BehatFeatures/web/search/search_projects_via_tags.feature index 1798d48d67..348cdc47a7 100644 --- a/tests/BehatFeatures/web/search/search_programs_via_tags.feature +++ b/tests/BehatFeatures/web/search/search_projects_via_tags.feature @@ -1,5 +1,5 @@ @web @search -Feature: Searching for programs with tags +Feature: Searching for projects with tags Background: Given there are users: @@ -18,7 +18,7 @@ Feature: Searching for programs with tags | 3 | project 3 | User1 | story | And I wait 1000 milliseconds - Scenario: Searching other programs with the same tag + Scenario: Searching other projects with the same tag Given I am on "/app/project/1" And I wait for the page to be loaded And I should see "project 1" diff --git a/tests/BehatFeatures/web/studio/studio-details__activity_list.feature b/tests/BehatFeatures/web/studio/studio-details__activity_list.feature index 5693209f2c..4e2afde5b0 100644 --- a/tests/BehatFeatures/web/studio/studio-details__activity_list.feature +++ b/tests/BehatFeatures/web/studio/studio-details__activity_list.feature @@ -8,8 +8,8 @@ Feature: Every studio provides a list of all members | 2 | Catrobat | And there are projects: | id | name | owned by | - | 1 | program 1 | Catrobat | - | 2 | program 2 | Catrobat | + | 1 | project 1 | Catrobat | + | 2 | project 2 | Catrobat | And there are studios: | id | name | description | allow_comments | is_public | | 1 | CatrobatStudio01 | hasADescription | true | true | @@ -19,7 +19,7 @@ Feature: Every studio provides a list of all members | 2 | Catrobat | 1 | member | And there are studio projects: | id | project | user | studio_id | - | 1 | program 1 | Catrobat | 1 | + | 1 | project 1 | Catrobat | 1 | And there are studio comments: | id | comment | user | studio_id | | 1 | Cool studio | Catrobat | 1 | diff --git a/tests/BehatFeatures/web/studio/studio-details__member_list.feature b/tests/BehatFeatures/web/studio/studio-details__member_list.feature index a5a733b4cf..38364d4e7d 100644 --- a/tests/BehatFeatures/web/studio/studio-details__member_list.feature +++ b/tests/BehatFeatures/web/studio/studio-details__member_list.feature @@ -8,8 +8,8 @@ Feature: Every studio provides a list of all members | 2 | Catrobat | And there are projects: | id | name | owned by | - | 1 | program 1 | Catrobat | - | 2 | program 2 | Catrobat | + | 1 | project 1 | Catrobat | + | 2 | project 2 | Catrobat | And there are studios: | id | name | description | allow_comments | is_public | | 1 | CatrobatStudio01 | hasADescription | true | true | @@ -19,7 +19,7 @@ Feature: Every studio provides a list of all members | 2 | Catrobat | 1 | member | And there are studio projects: | id | project | user | studio_id | - | 1 | program 1 | Catrobat | 1 | + | 1 | project 1 | Catrobat | 1 | Scenario: If I am not logged in I should not be able see all members Given I am on "/app/studio/1" diff --git a/tests/BehatFeatures/web/studio/studio-details__overview.feature b/tests/BehatFeatures/web/studio/studio-details__overview.feature index 8cf5429371..46803d9590 100644 --- a/tests/BehatFeatures/web/studio/studio-details__overview.feature +++ b/tests/BehatFeatures/web/studio/studio-details__overview.feature @@ -9,7 +9,7 @@ Feature: Every Studio should have an overview containing the most necessary info | 3 | Catrobat1 | And there are projects: | id | name | owned by | - | 1 | program 1 | Catrobat | + | 1 | project 1 | Catrobat | And there are studios: | id | name | description | allow_comments | is_public | | 1 | CatrobatStudio01 | hasADescription | true | true | @@ -21,7 +21,7 @@ Feature: Every Studio should have an overview containing the most necessary info | 5 | StudioAdmin | 2 | admin | And there are studio projects: | id | project | user | studio_id | - | 1 | program 1 | Catrobat | 1 | + | 1 | project 1 | Catrobat | 1 | And there are studio comments: | id | comment | user | studio_id | | 1 | Cool studio | Catrobat | 1 | diff --git a/tests/BehatFeatures/web/studio/studio_overview.feature b/tests/BehatFeatures/web/studio/studio_overview.feature index 27ff00bb44..bf58c7f433 100644 --- a/tests/BehatFeatures/web/studio/studio_overview.feature +++ b/tests/BehatFeatures/web/studio/studio_overview.feature @@ -9,7 +9,7 @@ Feature: Create new studio page | 3 | NewUser | And there are projects: | id | name | owned by | - | 1 | program 1 | Catrobat | + | 1 | project 1 | Catrobat | And there are studios: | id | name | description | allow_comments | is_public | | 1 | CatrobatStudio01 | hasADescription | true | true | diff --git a/tests/BehatFeatures/web/top-bar/top_app_bar_more_options.feature b/tests/BehatFeatures/web/top-bar/top_app_bar_more_options.feature index e7796a7392..7ebb90b406 100644 --- a/tests/BehatFeatures/web/top-bar/top_app_bar_more_options.feature +++ b/tests/BehatFeatures/web/top-bar/top_app_bar_more_options.feature @@ -13,7 +13,7 @@ Feature: On some page the top app bar should provide the user with additional fu | 1 | Catrobat | And there are projects: | id | name | owned by | - | 1 | program 1 | Catrobat | + | 1 | project 1 | Catrobat | And I am on "/app/project/1" And I wait for the page to be loaded Then the element "#top-app-bar__default" should be visible @@ -26,7 +26,7 @@ Feature: On some page the top app bar should provide the user with additional fu # | 1 | Catrobat | # And there are projects: # | id | name | owned by | -# | 1 | program 1 | Catrobat | +# | 1 | project 1 | Catrobat | # And I am on "/app/project/1" # And I wait for the page to be loaded # Then the element "#top-app-bar__default" should be visible @@ -41,7 +41,7 @@ Feature: On some page the top app bar should provide the user with additional fu | 1 | Catrobat | And there are projects: | id | name | owned by | - | 1 | program 1 | Catrobat | + | 1 | project 1 | Catrobat | And I am on "/app/project/1" And I wait for the page to be loaded Then the element "#top-app-bar__default" should be visible @@ -56,7 +56,7 @@ Feature: On some page the top app bar should provide the user with additional fu | 1 | Catrobat | And there are projects: | id | name | owned by | - | 1 | program 1 | Catrobat | + | 1 | project 1 | Catrobat | And I am on "/app/user/1" And I wait for the page to be loaded Then the element "#top-app-bar__default" should be visible diff --git a/tests/BehatFeatures/web/top-bar/top_app_bar_search.feature b/tests/BehatFeatures/web/top-bar/top_app_bar_search.feature index 0d15d23c32..1ae07b7843 100644 --- a/tests/BehatFeatures/web/top-bar/top_app_bar_search.feature +++ b/tests/BehatFeatures/web/top-bar/top_app_bar_search.feature @@ -97,8 +97,8 @@ Feature: Searching should be possible using a specific Search Top App Bar | 2 | User1 | And there are projects: | id | name | owned by | - | 1 | program 1 | User1 | - | 2 | test program | User1 | + | 1 | project 1 | User1 | + | 2 | test project | User1 | | 3 | Test advanced app | Catrobat | | 4 | Catrobat | User1 | | 5 | project 3 | Catrobat | @@ -108,16 +108,16 @@ Feature: Searching should be possible using a specific Search Top App Bar Given I am on "/app" And I wait for the page to be loaded Then I click "#top-app-bar__btn-search" - And I enter "program" into visible "#top-app-bar__search-input" + And I enter "project" into visible "#top-app-bar__search-input" And I press enter in the search bar And I wait for the page to be loaded - Then I should be on "/app/search/program" + Then I should be on "/app/search/project" Then I should see "Search results" And the element "#top-app-bar__btn-search-back" should be visible And the element "#top-app-bar__search-form" should be visible And the element "#top-app-bar__search-input" should be visible And the element "#top-app-bar__btn-search-clear" should be visible - Then the "top-app-bar__search-input" field should contain "program" + Then the "top-app-bar__search-input" field should contain "project" Then I enter "Test advanced" into visible "#top-app-bar__search-input" And I press enter in the search bar And I wait for the page to be loaded diff --git a/tests/BehatFeatures/web/translation/persist_machine_translation.feature b/tests/BehatFeatures/web/translation/persist_machine_translation.feature index 59d11e5f18..77c35460ae 100644 --- a/tests/BehatFeatures/web/translation/persist_machine_translation.feature +++ b/tests/BehatFeatures/web/translation/persist_machine_translation.feature @@ -15,7 +15,7 @@ Feature: Persist project and comment machine translation | 1 | 2 | 1 | c1 | | 2 | 1 | 1 | c2 | - Scenario: Create new entry the first time a program is translated + Scenario: Create new entry the first time a project is translated Given there are project machine translations: | project_id | source_language | target_language | provider | usage_count | And I switch the language to "French" @@ -27,7 +27,7 @@ Feature: Persist project and comment machine translation | project_id | source_language | target_language | provider | usage_count | | 1 | en | fr-FR | itranslate | 1 | - Scenario: Increment usage count if program entry already exists + Scenario: Increment usage count if project entry already exists Given there are project machine translations: | project_id | source_language | target_language | provider | usage_count | | 1 | en | fr-FR | itranslate | 2 | @@ -42,7 +42,7 @@ Feature: Persist project and comment machine translation | 1 | en | fr-FR | itranslate | 3 | | 2 | en | fr-FR | itranslate | 1 | - Scenario: Cache program translation if used often + Scenario: Cache project translation if used often Given there are project machine translations: | project_id | source_language | target_language | provider | usage_count | | 3 | en | fr-FR | itranslate | 15 | @@ -55,7 +55,7 @@ Feature: Persist project and comment machine translation | project_id | source_language | target_language | provider | usage_count | cached_name | cached_description | cached_credits | | 3 | en | fr-FR | itranslate | 16 | translated project3 | translated description3 | translated credit3 | - Scenario: Create new entry for database cached program translation + Scenario: Create new entry for database cached project translation Given there are project machine translations: | project_id | source_language | target_language | provider | usage_count | cached_name | cached_description | cached_credits | | 3 | en | fr-FR | itranslate | 16 | translated project3 | translated description3 | translated credit3 | @@ -69,7 +69,7 @@ Feature: Persist project and comment machine translation | 3 | en | fr-FR | itranslate | 16 | translated project3 | translated description3 | translated credit3 | | 3 | en | fr-FR | db | 1 | | | | - Scenario: Increment usage count for database cached program translation + Scenario: Increment usage count for database cached project translation Given there are project machine translations: | project_id | source_language | target_language | provider | usage_count | cached_name | cached_description | cached_credits | | 3 | en | fr-FR | itranslate | 16 | translated project3 | translated description3 | translated credit3 | @@ -84,7 +84,7 @@ Feature: Persist project and comment machine translation | 3 | en | fr-FR | itranslate | 16 | translated project3 | translated description3 | translated credit3 | | 3 | en | fr-FR | db | 2 | | | | - Scenario: Do not cache "cached" program translation + Scenario: Do not cache "cached" project translation Given there are project machine translations: | project_id | source_language | target_language | provider | usage_count | cached_name | cached_description | cached_credits | | 3 | en | fr-FR | itranslate | 16 | translated project3 | translated description3 | translated credit3 | diff --git a/tests/PhpUnit/Api/ProjectsApiTest.php b/tests/PhpUnit/Api/ProjectsApiTest.php index ea60fa8e63..9a07507a7c 100644 --- a/tests/PhpUnit/Api/ProjectsApiTest.php +++ b/tests/PhpUnit/Api/ProjectsApiTest.php @@ -13,7 +13,7 @@ use App\Api\Services\Projects\ProjectsRequestValidator; use App\Api\Services\Projects\ProjectsResponseManager; use App\Api\Services\ValidationWrapper; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; use App\Project\CatrobatFile\ExtractedCatrobatFile; use App\Project\CatrobatFile\ExtractedFileRepository; @@ -144,7 +144,7 @@ public function testProjectIdGet(): void $response_headers = []; $loader = $this->createMock(ProjectsApiLoader::class); - $loader->method('findProjectByID')->willReturn($this->createMock(Program::class)); + $loader->method('findProjectByID')->willReturn($this->createMock(Project::class)); $this->facade->method('getLoader')->willReturn($loader); $response = $this->object->projectIdGet('id', $response_code, $response_headers); @@ -153,14 +153,14 @@ public function testProjectIdGet(): void $this->assertInstanceOf(ProjectResponse::class, $response); } - private function projectIdPut_setLoaderAndAuthManager(MockObject|Program $project = null, MockObject|User $user = null): void + private function projectIdPut_setLoaderAndAuthManager(MockObject|Project $project = null, MockObject|User $user = null): void { if (is_null($user)) { $user = $this->createMock(User::class); } if (is_null($project)) { - $project = $this->createMock(Program::class); + $project = $this->createMock(Project::class); $project->method('getUser')->willReturn($user); } @@ -168,7 +168,7 @@ private function projectIdPut_setLoaderAndAuthManager(MockObject|Program $projec $this->projectIdPut_setAuthManager($user); } - private function projectIdPut_setLoader(null|MockObject|Program $project): void + private function projectIdPut_setLoader(null|MockObject|Project $project): void { $loader = $this->createMock(ProjectsApiLoader::class); $loader->method('findProjectByID')->willReturn($project); @@ -192,7 +192,7 @@ public function testProjectIdPut(): void $response_code = 200; $response_headers = []; - $project = new Program(); + $project = new Project(); $user = new User(); $project->setId('id'); $project->setName('Old name'); @@ -271,7 +271,7 @@ public function testProjectIdPutUnauthorized(): void $response_code = 200; $response_headers = []; - $this->projectIdPut_setLoader($this->createMock(Program::class)); + $this->projectIdPut_setLoader($this->createMock(Project::class)); $this->projectIdPut_setAuthManager(null); $update_project_request = $this->createMock(UpdateProjectRequest::class); @@ -294,7 +294,7 @@ public function testProjectIdPutForbidden(): void $response_code = 200; $response_headers = []; - $project = new Program(); + $project = new Project(); $user = new User(); $user->setId('user1'); $wrong_user = new User(); @@ -471,7 +471,7 @@ public function testProjectIdRecommendationsGet(): void $response_headers = []; $loader = $this->createMock(ProjectsApiLoader::class); - $loader->method('findProjectByID')->willReturn($this->createMock(Program::class)); + $loader->method('findProjectByID')->willReturn($this->createMock(Project::class)); $loader->method('getRecommendedProjects')->willReturn([]); $this->facade->method('getLoader')->willReturn($loader); @@ -657,7 +657,7 @@ public function testProjectsPost(): void $user = $this->createMock(User::class); $user->method('isVerified')->willReturn(true); $processor = $this->createMock(ProjectsApiProcessor::class); - $processor->method('addProject')->willReturn($this->createMock(Program::class)); + $processor->method('addProject')->willReturn($this->createMock(Project::class)); $authentication_manager = $this->createMock(AuthenticationManager::class); $authentication_manager->method('getAuthenticatedUser')->willReturn($user); $this->facade->method('getAuthenticationManager')->willReturn($authentication_manager); @@ -690,7 +690,7 @@ public function testProjectsPostValidationError(): void $validation_wrapper->method('hasError')->willReturn(true); $validator->method('validateUploadFile')->willReturn($validation_wrapper); $processor = $this->createMock(ProjectsApiProcessor::class); - $processor->method('addProject')->willReturn($this->createMock(Program::class)); + $processor->method('addProject')->willReturn($this->createMock(Project::class)); $authentication_manager = $this->createMock(AuthenticationManager::class); $user = $this->createMock(User::class); $user->method('isVerified')->willReturn(true); diff --git a/tests/PhpUnit/Project/AddProjectRequestTest.php b/tests/PhpUnit/Project/AddProjectRequestTest.php index cf82e1d280..8d0230b4aa 100644 --- a/tests/PhpUnit/Project/AddProjectRequestTest.php +++ b/tests/PhpUnit/Project/AddProjectRequestTest.php @@ -17,7 +17,7 @@ class AddProjectRequestTest extends TestCase { private File $file; - private AddProjectRequest $add_program_request; + private AddProjectRequest $add_project_request; private MockObject|User $user; @@ -26,44 +26,44 @@ protected function setUp(): void $this->user = $this->createMock(User::class); fopen('/tmp/PhpUnitTest', 'w'); $this->file = new File('/tmp/PhpUnitTest'); - $this->add_program_request = new AddProjectRequest($this->user, $this->file); + $this->add_project_request = new AddProjectRequest($this->user, $this->file); } public function testInitialization(): void { - $this->assertInstanceOf(AddProjectRequest::class, $this->add_program_request); + $this->assertInstanceOf(AddProjectRequest::class, $this->add_project_request); } public function testHoldsAUser(): void { $new_user = $this->createMock(User::class); - $this->assertSame($this->user, $this->add_program_request->getUser()); - $this->add_program_request->setUser($new_user); - $this->assertSame($new_user, $this->add_program_request->getUser()); + $this->assertSame($this->user, $this->add_project_request->getUser()); + $this->add_project_request->setUser($new_user); + $this->assertSame($new_user, $this->add_project_request->getUser()); } public function testHoldsAFile(): void { $new_file = $this->file; - $this->assertSame($this->file, $this->add_program_request->getProjectFile()); - $this->add_program_request->setProjectFile($new_file); - $this->assertSame($new_file, $this->add_program_request->getProjectFile()); + $this->assertSame($this->file, $this->add_project_request->getProjectFile()); + $this->add_project_request->setProjectFile($new_file); + $this->assertSame($new_file, $this->add_project_request->getProjectFile()); } public function testHoldsAnIp(): void { - $this->assertSame('127.0.0.1', $this->add_program_request->getIp()); + $this->assertSame('127.0.0.1', $this->add_project_request->getIp()); } public function testHasALanguage(): void { - $this->assertNull($this->add_program_request->getLanguage()); - $this->add_program_request->setLanguage('de'); - $this->assertSame('de', $this->add_program_request->getLanguage()); + $this->assertNull($this->add_project_request->getLanguage()); + $this->add_project_request->setLanguage('de'); + $this->assertSame('de', $this->add_project_request->getLanguage()); } public function testHasAFlavor(): void { - $this->assertSame('pocketcode', $this->add_program_request->getFlavor()); + $this->assertSame('pocketcode', $this->add_project_request->getFlavor()); } } diff --git a/tests/PhpUnit/Project/CatrobatCode/Parser/CatrobatCodeParserTest.php b/tests/PhpUnit/Project/CatrobatCode/Parser/CatrobatCodeParserTest.php index da2a19f9da..457ea2861a 100644 --- a/tests/PhpUnit/Project/CatrobatCode/Parser/CatrobatCodeParserTest.php +++ b/tests/PhpUnit/Project/CatrobatCode/Parser/CatrobatCodeParserTest.php @@ -30,10 +30,10 @@ public function tearDown(): void FileHelper::emptyDirectory(BootstrapExtension::$CACHE_DIR); } - #[DataProvider('provideValidProgramData')] - public function testMustReturnParsedProgram(mixed $extracted_catrobat_program): void + #[DataProvider('provideValidProjectData')] + public function testMustReturnParsedProject(mixed $extracted_catrobat_project): void { - $actual = $this->parser->parse($extracted_catrobat_program); + $actual = $this->parser->parse($extracted_catrobat_project); $expected = [ ParsedSimpleProject::class, ParsedSceneProject::class, @@ -45,44 +45,44 @@ public function testMustReturnParsedProgram(mixed $extracted_catrobat_program): )); } - public function testMustReturnParsedSimpleProgramIfNoScenes(): void + public function testMustReturnParsedSimpleProjectIfNoScenes(): void { - $extracted_catrobat_program = new ExtractedCatrobatFile(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/SimpleProgram/', '', ''); - $actual = $this->parser->parse($extracted_catrobat_program); + $extracted_catrobat_project = new ExtractedCatrobatFile(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/SimpleProgram/', '', ''); + $actual = $this->parser->parse($extracted_catrobat_project); $expected = ParsedSimpleProject::class; $this->assertInstanceOf($expected, $actual); } - public function testMustReturnParsedSceneProgramIfScenes(): void + public function testMustReturnParsedSceneProjectIfScenes(): void { - $extracted_catrobat_program = new ExtractedCatrobatFile(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/SceneProgram/', '', ''); - $actual = $this->parser->parse($extracted_catrobat_program); + $extracted_catrobat_project = new ExtractedCatrobatFile(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/SceneProgram/', '', ''); + $actual = $this->parser->parse($extracted_catrobat_project); $expected = ParsedSceneProject::class; $this->assertInstanceOf($expected, $actual); } - #[DataProvider('provideFaultyProgramData')] - public function testMustReturnNullOnError(ExtractedCatrobatFile $faulty_program): void + #[DataProvider('provideFaultyProjectData')] + public function testMustReturnNullOnError(ExtractedCatrobatFile $faulty_project): void { - $this->assertNull($this->parser->parse($faulty_program)); + $this->assertNull($this->parser->parse($faulty_project)); } /** * @return \App\Project\CatrobatFile\ExtractedCatrobatFile[][] */ - public static function provideValidProgramData(): array + public static function provideValidProjectData(): array { - $programs = []; - $programs[] = [new ExtractedCatrobatFile(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/SimpleProgram/', '', '')]; - $programs[] = [new ExtractedCatrobatFile(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/SceneProgram/', '', '')]; - $programs[] = [new ExtractedCatrobatFile(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/', '', '')]; + $projects = []; + $projects[] = [new ExtractedCatrobatFile(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/SimpleProgram/', '', '')]; + $projects[] = [new ExtractedCatrobatFile(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/SceneProgram/', '', '')]; + $projects[] = [new ExtractedCatrobatFile(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/AllBricksProgram/', '', '')]; - return $programs; + return $projects; } - public static function provideFaultyProgramData(): \Generator + public static function provideFaultyProjectData(): \Generator { yield [ new ExtractedCatrobatFile( diff --git a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSceneProgramTest.php b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSceneProjectTest.php similarity index 80% rename from tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSceneProgramTest.php rename to tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSceneProjectTest.php index 783388422e..79b668184e 100644 --- a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSceneProgramTest.php +++ b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSceneProjectTest.php @@ -15,21 +15,21 @@ * * @covers \App\Project\CatrobatCode\Parser\ParsedSceneProject */ -class ParsedSceneProgramTest extends TestCase +class ParsedSceneProjectTest extends TestCase { - protected ParsedSceneProject $program; + protected ParsedSceneProject $project; protected function setUp(): void { $xml_properties = simplexml_load_file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/SceneProgram/code.xml'); Assert::assertNotFalse($xml_properties); - $this->program = new ParsedSceneProject($xml_properties); + $this->project = new ParsedSceneProject($xml_properties); } #[DataProvider('provideMethodNames')] public function testMustHaveMethod(mixed $method_name): void { - $this->assertTrue(method_exists($this->program, $method_name)); + $this->assertTrue(method_exists($this->project, $method_name)); } /** @@ -49,7 +49,7 @@ public static function provideMethodNames(): array */ public function testHasScenesMustReturnTrue(): void { - $this->assertTrue($this->program->hasScenes()); + $this->assertTrue($this->project->hasScenes()); } /** @@ -57,7 +57,7 @@ public function testHasScenesMustReturnTrue(): void */ public function testGetCodeStatisticMustReturnCodeStatistic(): void { - $actual = $this->program->getCodeStatistic(); + $actual = $this->project->getCodeStatistic(); $expected = CodeStatistic::class; $this->assertInstanceOf($expected, $actual); @@ -70,7 +70,7 @@ public function testGetScenesMustReturnArrayOfScenes(): void { $expected = ParsedScene::class; - foreach ($this->program->getScenes() as $actual) { + foreach ($this->project->getScenes() as $actual) { $this->assertInstanceOf($expected, $actual); } } diff --git a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSimpleProgramTest.php b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSimpleProjectTest.php similarity index 79% rename from tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSimpleProgramTest.php rename to tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSimpleProjectTest.php index 38b603a046..f912f8b6c9 100644 --- a/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSimpleProgramTest.php +++ b/tests/PhpUnit/Project/CatrobatCode/Parser/ParsedSimpleProjectTest.php @@ -14,21 +14,21 @@ * * @covers \App\Project\CatrobatCode\Parser\ParsedSimpleProject */ -class ParsedSimpleProgramTest extends TestCase +class ParsedSimpleProjectTest extends TestCase { - protected ParsedSimpleProject $program; + protected ParsedSimpleProject $project; protected function setUp(): void { $xml_properties = simplexml_load_file(BootstrapExtension::$FIXTURES_DIR.'ValidPrograms/SimpleProgram/code.xml'); Assert::assertNotFalse($xml_properties); - $this->program = new ParsedSimpleProject($xml_properties); + $this->project = new ParsedSimpleProject($xml_properties); } #[DataProvider('provideMethodNames')] public function testMustHaveMethod(mixed $method_name): void { - $this->assertTrue(method_exists($this->program, $method_name)); + $this->assertTrue(method_exists($this->project, $method_name)); } /** @@ -47,7 +47,7 @@ public static function provideMethodNames(): array */ public function testHasScenesMustReturnFalse(): void { - $this->assertFalse($this->program->hasScenes()); + $this->assertFalse($this->project->hasScenes()); } /** @@ -55,7 +55,7 @@ public function testHasScenesMustReturnFalse(): void */ public function testGetCodeStatisticMustReturnCodeStatistic(): void { - $actual = $this->program->getCodeStatistic(); + $actual = $this->project->getCodeStatistic(); $expected = CodeStatistic::class; $this->assertInstanceOf($expected, $actual); diff --git a/tests/PhpUnit/Project/CatrobatFile/ExtractedCatrobatFileTest.php b/tests/PhpUnit/Project/CatrobatFile/ExtractedCatrobatFileTest.php index 3b92f154b4..b88bf5dd4b 100644 --- a/tests/PhpUnit/Project/CatrobatFile/ExtractedCatrobatFileTest.php +++ b/tests/PhpUnit/Project/CatrobatFile/ExtractedCatrobatFileTest.php @@ -2,7 +2,7 @@ namespace Tests\PhpUnit\Project\CatrobatFile; -use App\DB\EntityRepository\Project\ProgramRepository; +use App\DB\EntityRepository\Project\ProjectRepository; use App\Project\CatrobatFile\ExtractedCatrobatFile; use App\Project\CatrobatFile\InvalidCatrobatFileException; use App\Project\Remix\RemixData; @@ -30,17 +30,17 @@ public function testInitialization(): void $this->assertInstanceOf(ExtractedCatrobatFile::class, $this->extracted_catrobat_file); } - public function testGetsTheProgramNameFromXml(): void + public function testGetsTheProjectNameFromXml(): void { $this->assertSame('test', $this->extracted_catrobat_file->getName()); } - public function testGetsTheProgramDescriptionFromXml(): void + public function testGetsTheProjectDescriptionFromXml(): void { $this->assertSame('', $this->extracted_catrobat_file->getDescription()); } - public function testGetsTheProgramCreditsFromXml(): void + public function testGetsTheProjectCreditsFromXml(): void { $this->assertSame('', $this->extracted_catrobat_file->getNotesAndCredits()); } @@ -50,7 +50,7 @@ public function testGetsTheProgramCreditsFromXml(): void * * @psalm-suppress InvalidPropertyFetch */ - public function testSetsTheProgramName(): void + public function testSetsTheProjectName(): void { $target_dir = BootstrapExtension::$CACHE_DIR.'base/'; $filesystem = new Filesystem(); @@ -72,7 +72,7 @@ public function testSetsTheProgramName(): void * * @psalm-suppress InvalidPropertyFetch */ - public function testSetsTheProgramDescription(): void + public function testSetsTheProjectDescription(): void { $target_dir = BootstrapExtension::$CACHE_DIR.'base/'; $filesystem = new Filesystem(); @@ -94,7 +94,7 @@ public function testSetsTheProgramDescription(): void * * @psalm-suppress InvalidPropertyFetch */ - public function testSetsTheProgramCredits(): void + public function testSetsTheProjectCredits(): void { $target_dir = BootstrapExtension::$CACHE_DIR.'base/'; $filesystem = new Filesystem(); @@ -129,16 +129,16 @@ public function testGetsTheRemixUrlsStringFromXml(): void public function testGetsRelativeAndAbsoluteRemixUrls(): void { - $program_repository = $this->createMock(ProgramRepository::class); + $project_repository = $this->createMock(ProjectRepository::class); $first_expected_url = 'https://scratch.mit.edu/projects/117697631/'; $second_expected_url = '/app/project/3570'; - $new_program_id = '3571'; - $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); + $new_project_id = '3571'; + $urls = $this->extracted_catrobat_file->getRemixesData($new_project_id, true, $project_repository); $expectedCount = 2; - $expectedProgramIds = ['117697631', '3570']; + $expectedProjectIds = ['117697631', '3570']; $expectedUrls = [$first_expected_url, $second_expected_url]; - $this->assertions($expectedCount, $urls, $expectedUrls, $expectedProgramIds, [true, false], [true, false]); + $this->assertions($expectedCount, $urls, $expectedUrls, $expectedProjectIds, [true, false], [true, false]); /* $this->assertCount(2, $urls); @@ -161,11 +161,11 @@ public function testGetsRelativeAndAbsoluteRemixUrls(): void */ public function testCanExtractSimpleCatrobatAbsoluteRemixUrl(): void { - $program_repository = $this->createMock(ProgramRepository::class); + $project_repository = $this->createMock(ProjectRepository::class); $first_expected_url = 'https://pocketcode.org/details/1234/'; $this->extracted_catrobat_file->getProjectXmlProperties()->header->url = $first_expected_url; - $new_program_id = '1300'; - $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); + $new_project_id = '1300'; + $urls = $this->extracted_catrobat_file->getRemixesData($new_project_id, true, $project_repository); $this->assertions(1, $urls, [$first_expected_url], ['1234'], [false], [true]); } @@ -175,11 +175,11 @@ public function testCanExtractSimpleCatrobatAbsoluteRemixUrl(): void */ public function testNotExtractNumberFromNormalText(): void { - $program_repository = $this->createMock(ProgramRepository::class); + $project_repository = $this->createMock(ProjectRepository::class); $first_expected_url = 'SomeText 123'; $this->extracted_catrobat_file->getProjectXmlProperties()->header->url = $first_expected_url; - $new_program_id = '124'; - $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); + $new_project_id = '124'; + $urls = $this->extracted_catrobat_file->getRemixesData($new_project_id, true, $project_repository); $this->assertCount(0, $urls); } @@ -188,11 +188,11 @@ public function testNotExtractNumberFromNormalText(): void */ public function testCanExtractSimpleScratchAbsoluteRemixUrl(): void { - $program_repository = $this->createMock(ProgramRepository::class); + $project_repository = $this->createMock(ProjectRepository::class); $first_expected_url = 'https://scratch.mit.edu/projects/117697631/'; $this->extracted_catrobat_file->getProjectXmlProperties()->header->url = $first_expected_url; - $new_program_id = '1'; - $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); + $new_project_id = '1'; + $urls = $this->extracted_catrobat_file->getRemixesData($new_project_id, true, $project_repository); $this->assertions(1, $urls, [$first_expected_url], ['117697631'], [true], [true]); } @@ -202,11 +202,11 @@ public function testCanExtractSimpleScratchAbsoluteRemixUrl(): void */ public function testCanExtractSimpleRelativeCatrobatRemixUrl(): void { - $program_repository = $this->createMock(ProgramRepository::class); + $project_repository = $this->createMock(ProjectRepository::class); $first_expected_url = '/app/flavors/3570/'; $this->extracted_catrobat_file->getProjectXmlProperties()->header->url = $first_expected_url; - $new_program_id = '6310'; - $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); + $new_project_id = '6310'; + $urls = $this->extracted_catrobat_file->getRemixesData($new_project_id, true, $project_repository); $this->assertions(1, $urls, [$first_expected_url], ['3570'], [false], [false]); } @@ -214,16 +214,16 @@ public function testCanExtractSimpleRelativeCatrobatRemixUrl(): void /** * @psalm-suppress UndefinedPropertyAssignment */ - public function testCanExtractMergedProgramRemixUrls(): void + public function testCanExtractMergedProjectRemixUrls(): void { - $program_repository = $this->createMock(ProgramRepository::class); + $project_repository = $this->createMock(ProjectRepository::class); $first_expected_url = 'https://share2.catrob.at/details/1234'; $second_expected_url = 'http://pocketcode.org/details/3570/'; - $new_program_id = '3571'; + $new_project_id = '3571'; $remixes_string = 'スーパー時計 12 ['.$first_expected_url.'], The Periodic Table 2 ['.$second_expected_url.']]'; /* @psalm-suppress UndefinedPropertyAssignment */ $this->extracted_catrobat_file->getProjectXmlProperties()->header->url = $remixes_string; - $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); + $urls = $this->extracted_catrobat_file->getRemixesData($new_project_id, true, $project_repository); $this->assertions(2, $urls, [$first_expected_url, $second_expected_url], ['1234', '3570'], [false, false], [true, true]); } @@ -231,15 +231,15 @@ public function testCanExtractMergedProgramRemixUrls(): void /** * @psalm-suppress UndefinedPropertyAssignment */ - public function testExtractUniqueProgramRemixUrls(): void + public function testExtractUniqueProjectRemixUrls(): void { - $program_repository = $this->createMock(ProgramRepository::class); + $project_repository = $this->createMock(ProjectRepository::class); $first_expected_url = 'https://share2.catrob.at/details/1234'; $second_expected_url = 'http://pocketcode.org/details/1234/'; - $new_program_id = '3571'; + $new_project_id = '3571'; $remixes_string = 'スーパー時計 12 ['.$first_expected_url.'], The Periodic Table 2 ['.$second_expected_url.']]'; $this->extracted_catrobat_file->getProjectXmlProperties()->header->url = $remixes_string; - $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); + $urls = $this->extracted_catrobat_file->getRemixesData($new_project_id, true, $project_repository); $this->assertions(1, $urls, [$first_expected_url, $second_expected_url], ['1234'], [false], [true]); } @@ -247,15 +247,15 @@ public function testExtractUniqueProgramRemixUrls(): void /** * @psalm-suppress UndefinedPropertyAssignment */ - public function testDontExtractProgramRemixUrlsReferencingToCurrentProgram(): void + public function testDontExtractProjectRemixUrlsReferencingToCurrentProject(): void { - $program_repository = $this->createMock(ProgramRepository::class); + $project_repository = $this->createMock(ProjectRepository::class); $first_expected_url = 'https://share2.catrob.at/details/1234'; $second_expected_url = 'http://pocketcode.org/details/790/'; - $new_program_id = '1234'; + $new_project_id = '1234'; $remixes_string = 'スーパー時計 12 ['.$first_expected_url.'], The Periodic Table 2 ['.$second_expected_url.']]'; $this->extracted_catrobat_file->getProjectXmlProperties()->header->url = $remixes_string; - $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); + $urls = $this->extracted_catrobat_file->getRemixesData($new_project_id, true, $project_repository); $this->assertions(1, $urls, [$second_expected_url], ['790'], [false], [true]); } @@ -263,15 +263,15 @@ public function testDontExtractProgramRemixUrlsReferencingToCurrentProgram(): vo /** * @psalm-suppress UndefinedPropertyAssignment */ - public function testExtractOnlyOlderProgramRemixUrls(): void + public function testExtractOnlyOlderProjectRemixUrls(): void { - $program_repository = $this->createMock(ProgramRepository::class); + $project_repository = $this->createMock(ProjectRepository::class); $first_expected_url = 'https://share2.catrob.at/details/1234'; $second_expected_url = 'http://pocketcode.org/details/790/'; - $new_program_id = '791'; + $new_project_id = '791'; $remixes_string = 'スーパー時計 12 ['.$first_expected_url.'], The Periodic Table 2 ['.$second_expected_url.']]'; $this->extracted_catrobat_file->getProjectXmlProperties()->header->url = $remixes_string; - $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); + $urls = $this->extracted_catrobat_file->getRemixesData($new_project_id, true, $project_repository); $this->assertions(1, $urls, [$second_expected_url], ['790'], [false], [true]); } @@ -279,18 +279,18 @@ public function testExtractOnlyOlderProgramRemixUrls(): void /** * @psalm-suppress UndefinedPropertyAssignment */ - public function testCanExtractDoubleMergedProgramRemixUrls(): void + public function testCanExtractDoubleMergedProjectRemixUrls(): void { - $program_repository = $this->createMock(ProgramRepository::class); + $project_repository = $this->createMock(ProjectRepository::class); $first_expected_url = 'https://share2.catrob.at/details/1234'; $second_expected_url = 'http://pocketcode.org/details/3570/'; $third_expected_url = 'https://scratch.mit.edu/projects/121648946/'; - $new_program_id = '3571'; + $new_project_id = '3571'; $remixes_string = 'スーパー時計 12 ['.$first_expected_url .'], いやいや棒 [ 01 やねうら部屋(びっくりハウス) remix お化け屋敷 ['.$second_expected_url .'], The Periodic Table 2 ['.$third_expected_url.']]'; $this->extracted_catrobat_file->getProjectXmlProperties()->header->url = $remixes_string; - $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); + $urls = $this->extracted_catrobat_file->getRemixesData($new_project_id, true, $project_repository); $this->assertions(3, $urls, [$first_expected_url, $second_expected_url, $third_expected_url], ['1234', '3570', '121648946'], [false, false, true], [true, true, true]); @@ -299,18 +299,18 @@ public function testCanExtractDoubleMergedProgramRemixUrls(): void /** * @psalm-suppress UndefinedPropertyAssignment */ - public function testExtractUniqueProgramRemixUrlsOfDoubleMergedProgram(): void + public function testExtractUniqueProjectRemixUrlsOfDoubleMergedProject(): void { - $program_repository = $this->createMock(ProgramRepository::class); + $project_repository = $this->createMock(ProjectRepository::class); $first_expected_url = 'https://share2.catrob.at/details/1234'; $second_expected_url = 'https://scratch.mit.edu/projects/121648946/'; $third_expected_url = 'http://pocketcode.org/details/1234/'; - $new_program_id = '3571'; + $new_project_id = '3571'; $remixes_string = 'スーパー時計 12 ['.$first_expected_url .'], いやいや棒 [ 01 やねうら部屋(びっくりハウス) remix お化け屋敷 ['.$second_expected_url .'], The Periodic Table 2 ['.$third_expected_url.']]'; $this->extracted_catrobat_file->getProjectXmlProperties()->header->url = $remixes_string; - $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); + $urls = $this->extracted_catrobat_file->getRemixesData($new_project_id, true, $project_repository); $this->assertions(2, $urls, [$first_expected_url, $second_expected_url], ['1234', '121648946'], [false, true], [true, true]); @@ -319,18 +319,18 @@ public function testExtractUniqueProgramRemixUrlsOfDoubleMergedProgram(): void /** * @psalm-suppress UndefinedPropertyAssignment */ - public function testDontExtractProgramRemixUrlsReferencingToCurrentDoubleMergedProgram(): void + public function testDontExtractProjectRemixUrlsReferencingToCurrentDoubleMergedProject(): void { - $program_repository = $this->createMock(ProgramRepository::class); + $project_repository = $this->createMock(ProjectRepository::class); $first_expected_url = 'https://share2.catrob.at/details/1234'; $second_expected_url = 'http://pocketcode.org/details/7901'; $third_expected_url = 'http://pocketcode.org/details/1234/'; - $new_program_id = '7901'; + $new_project_id = '7901'; $remixes_string = 'スーパー時計 12 ['.$first_expected_url .'], いやいや棒 [ 01 やねうら部屋(びっくりハウス) remix お化け屋敷 ['.$second_expected_url .'], The Periodic Table 2 ['.$third_expected_url.']]'; $this->extracted_catrobat_file->getProjectXmlProperties()->header->url = $remixes_string; - $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); + $urls = $this->extracted_catrobat_file->getRemixesData($new_project_id, true, $project_repository); $this->assertions(1, $urls, [$first_expected_url], ['1234'], [false], [true]); @@ -341,17 +341,17 @@ public function testDontExtractProgramRemixUrlsReferencingToCurrentDoubleMergedP */ public function testCanExtractMultipleMergedRemixUrls(): void { - $program_repository = $this->createMock(ProgramRepository::class); + $project_repository = $this->createMock(ProjectRepository::class); $first_expected_url = 'https://scratch.mit.edu/projects/117697631/'; $second_expected_url = '/pocketalice/project/3570'; $third_expected_url = 'https://scratch.mit.edu/projects/121648946/'; $fourth_expected_url = 'https://share.catrob.at/app/project/16267'; - $new_program_id = '16268'; + $new_project_id = '16268'; $remixes_string = 'いやいや棒 12 [いやいや棒 9010~(89) [やねうら部屋(びっくりハウス) remix お化け屋敷 ['.$first_expected_url .'], The 12 Periodic Table 234 ['.$second_expected_url.']], スーパー時計 ['.$third_expected_url .']], NYAN CAT RUNNER (BETA) ['.$fourth_expected_url.']'; $this->extracted_catrobat_file->getProjectXmlProperties()->header->url = $remixes_string; - $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); + $urls = $this->extracted_catrobat_file->getRemixesData($new_project_id, true, $project_repository); $this->assertions(4, $urls, [$first_expected_url, $second_expected_url, $third_expected_url, $fourth_expected_url], ['117697631', '3570', '121648946', '16267'], [true, false, true, false], [true, false, true, true]); @@ -360,19 +360,19 @@ public function testCanExtractMultipleMergedRemixUrls(): void /** * @psalm-suppress UndefinedPropertyAssignment */ - public function testExtractUniqueProgramRemixUrlsOfMultipleMergedProgram(): void + public function testExtractUniqueProjectRemixUrlsOfMultipleMergedProject(): void { - $program_repository = $this->createMock(ProgramRepository::class); + $project_repository = $this->createMock(ProjectRepository::class); $first_expected_url = 'https://scratch.mit.edu/projects/117697631/'; $second_expected_url = '/pocketalice/project/16267'; $third_expected_url = $first_expected_url; $fourth_expected_url = 'https://share.catrob.at/app/project/16267'; - $new_program_id = '16268'; + $new_project_id = '16268'; $remixes_string = 'いやいや棒 12 [いやいや棒 9010~(89) [やねうら部屋(びっくりハウス) remix お化け屋敷 ['.$first_expected_url .'], The 12 Periodic Table 234 ['.$second_expected_url.']], スーパー時計 ['.$third_expected_url .']], NYAN CAT RUNNER (BETA) ['.$fourth_expected_url.']'; $this->extracted_catrobat_file->getProjectXmlProperties()->header->url = $remixes_string; - $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); + $urls = $this->extracted_catrobat_file->getRemixesData($new_project_id, true, $project_repository); $this->assertions(2, $urls, [$first_expected_url, $second_expected_url], ['117697631', '16267'], [true, false], [true, false]); @@ -381,19 +381,19 @@ public function testExtractUniqueProgramRemixUrlsOfMultipleMergedProgram(): void /** * @psalm-suppress UndefinedPropertyAssignment */ - public function testExtractOnlyOlderProgramRemixUrlsOfMultipleMergedProgramIfItIsAnInitialVersion(): void + public function testExtractOnlyOlderProjectRemixUrlsOfMultipleMergedProjectIfItIsAnInitialVersion(): void { - $program_repository = $this->createMock(ProgramRepository::class); + $project_repository = $this->createMock(ProjectRepository::class); $first_expected_url = 'https://scratch.mit.edu/projects/117697631/'; $second_expected_url = '/pocketalice/project/16268'; $third_expected_url = $first_expected_url; $fourth_expected_url = 'https://share.catrob.at/app/project/16268'; - $new_program_id = '16267'; + $new_project_id = '16267'; $remixes_string = 'いやいや棒 12 [いやいや棒 9010~(89) [やねうら部屋(びっくりハウス) remix お化け屋敷 ['.$first_expected_url .'], The 12 Periodic Table 234 ['.$second_expected_url.']], スーパー時計 ['.$third_expected_url .']], NYAN CAT RUNNER (BETA) ['.$fourth_expected_url.']'; $this->extracted_catrobat_file->getProjectXmlProperties()->header->url = $remixes_string; - $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, true, $program_repository); + $urls = $this->extracted_catrobat_file->getRemixesData($new_project_id, true, $project_repository); $this->assertions(1, $urls, [$first_expected_url], ['117697631'], [true], [true]); @@ -402,19 +402,19 @@ public function testExtractOnlyOlderProgramRemixUrlsOfMultipleMergedProgramIfItI /** * @psalm-suppress UndefinedPropertyAssignment */ - public function testExtractOlderProgramRemixUrlsOfMultipleMergedProgramIfItIsNotAnInitialVersion(): void + public function testExtractOlderProjectRemixUrlsOfMultipleMergedProjectIfItIsNotAnInitialVersion(): void { - $program_repository = $this->createMock(ProgramRepository::class); + $project_repository = $this->createMock(ProjectRepository::class); $first_expected_url = 'https://scratch.mit.edu/projects/117697631/'; $second_expected_url = '/pocketalice/project/16267'; $third_expected_url = $first_expected_url; $fourth_expected_url = 'https://share.catrob.at/app/project/16268'; - $new_program_id = '16267'; + $new_project_id = '16267'; $remixes_string = 'いやいや棒 12 [いやいや棒 9010~(89) [やねうら部屋(びっくりハウス) remix お化け屋敷 ['.$first_expected_url .'], The 12 Periodic Table 234 ['.$second_expected_url.']], スーパー時計 ['.$third_expected_url .']], NYAN CAT RUNNER (BETA) ['.$fourth_expected_url.']'; $this->extracted_catrobat_file->getProjectXmlProperties()->header->url = $remixes_string; - $urls = $this->extracted_catrobat_file->getRemixesData($new_program_id, false, $program_repository); + $urls = $this->extracted_catrobat_file->getRemixesData($new_project_id, false, $project_repository); $this->assertions(2, $urls, [$first_expected_url, $fourth_expected_url], ['117697631', '16268'], [true, false], [true, true]); @@ -513,14 +513,14 @@ public function testIOSXMLVersionWorksWithCurrentRegex(): void /** * @psalm-suppress UndefinedPropertyAssignment */ - private function assertions(int $expectedCount, array $urls, array $expectedURLs, array $expectedProgramIds, array $scratch, array $absolutePaths): void + private function assertions(int $expectedCount, array $urls, array $expectedURLs, array $expectedProjectIds, array $scratch, array $absolutePaths): void { $this->assertCount($expectedCount, $urls); for ($i = 0; $i < $expectedCount; ++$i) { $this->assertInstanceOf(RemixData::class, $urls[$i]); $this->assertSame($expectedURLs[$i], $urls[$i]->getUrl()); - $this->assertSame($expectedProgramIds[$i], $urls[$i]->getProjectId()); + $this->assertSame($expectedProjectIds[$i], $urls[$i]->getProjectId()); if ($scratch[$i]) { $this->assertTrue($urls[$i]->isScratchProject()); } else { diff --git a/tests/PhpUnit/Project/CatrobatFile/LicenseUpdaterEventSubscriberTest.php b/tests/PhpUnit/Project/CatrobatFile/LicenseUpdaterEventSubscriberTest.php index 4338ee640e..07f046e172 100644 --- a/tests/PhpUnit/Project/CatrobatFile/LicenseUpdaterEventSubscriberTest.php +++ b/tests/PhpUnit/Project/CatrobatFile/LicenseUpdaterEventSubscriberTest.php @@ -50,7 +50,7 @@ public function testSetsMediaLicense(): void Assert::assertEquals($xml->header->mediaLicense, 'https://developer.catrobat.org/ccbysa_v4'); } - public function testSetsProgramLicense(): void + public function testSetsProjectLicense(): void { $filesystem = new Filesystem(); $filesystem->mirror(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base', BootstrapExtension::$CACHE_DIR.'base'); diff --git a/tests/PhpUnit/Project/CatrobatFile/NameValidatorEventSubscriberTest.php b/tests/PhpUnit/Project/CatrobatFile/NameValidatorEventSubscriberTest.php index 178ad68e5b..e1a8af95ba 100644 --- a/tests/PhpUnit/Project/CatrobatFile/NameValidatorEventSubscriberTest.php +++ b/tests/PhpUnit/Project/CatrobatFile/NameValidatorEventSubscriberTest.php @@ -26,7 +26,7 @@ public function testInitialization(): void $this->assertInstanceOf(NameValidatorEventSubscriber::class, $this->name_validator); } - public function testMakesSureTheGivenProgramNameIsValid(): void + public function testMakesSureTheGivenProjectNameIsValid(): void { $file = $this->createMock(ExtractedCatrobatFile::class); $file->expects($this->atLeastOnce())->method('getName')->willReturn('John Doe'); diff --git a/tests/PhpUnit/Project/CatrobatFile/ProjectFileRepositoryTest.php b/tests/PhpUnit/Project/CatrobatFile/ProjectFileRepositoryTest.php index 1897c65c36..18b55a91f6 100644 --- a/tests/PhpUnit/Project/CatrobatFile/ProjectFileRepositoryTest.php +++ b/tests/PhpUnit/Project/CatrobatFile/ProjectFileRepositoryTest.php @@ -24,7 +24,7 @@ class ProjectFileRepositoryTest extends TestCase private string $extract_dir; - private ProjectFileRepository $program_file_repository; + private ProjectFileRepository $project_file_repository; protected function setUp(): void { @@ -34,7 +34,7 @@ protected function setUp(): void $filesystem->mkdir($this->storage_dir); $filesystem->mkdir($this->extract_dir); $filesystem->mkdir($this->storage_dir.'tmp/'); - $this->program_file_repository = new ProjectFileRepository($this->storage_dir, $this->extract_dir, new CatrobatFileCompressor()); + $this->project_file_repository = new ProjectFileRepository($this->storage_dir, $this->extract_dir, new CatrobatFileCompressor()); } protected function tearDown(): void @@ -44,21 +44,21 @@ protected function tearDown(): void public function testInitialization(): void { - $this->assertInstanceOf(ProjectFileRepository::class, $this->program_file_repository); + $this->assertInstanceOf(ProjectFileRepository::class, $this->project_file_repository); } public function testThrowsAnExceptionIfDirectoryIsNotFound(): void { $this->expectException(\Exception::class); $file_compressor = $this->createMock(CatrobatFileCompressor::class); - $this->program_file_repository = new ProjectFileRepository(__DIR__.'/invalid_directory/', $this->extract_dir, $file_compressor); + $this->project_file_repository = new ProjectFileRepository(__DIR__.'/invalid_directory/', $this->extract_dir, $file_compressor); } public function testThrowsAnExceptionIfDirectoryIsNotFound2(): void { $this->expectException(\Exception::class); $file_compressor = $this->createMock(CatrobatFileCompressor::class); - $this->program_file_repository = new ProjectFileRepository($this->storage_dir, __DIR__.'/invalid_directory/', $file_compressor); + $this->project_file_repository = new ProjectFileRepository($this->storage_dir, __DIR__.'/invalid_directory/', $file_compressor); } public function testStoresAFileToTheGivenDirectory(): void @@ -67,18 +67,18 @@ public function testStoresAFileToTheGivenDirectory(): void $id = 'test'; $file = new File($file_name); - $this->program_file_repository->saveProjectZipFile($file, $id); + $this->project_file_repository->saveProjectZipFile($file, $id); $finder = new Finder(); Assert::assertEquals(1, $finder->files()->in($this->storage_dir)->count()); } - public function testSavesAGivenProgramDirectory(): void + public function testSavesAGivenProjectDirectory(): void { - $extracted_program = new ExtractedCatrobatFile(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/', '/webpath', 'hash'); + $extracted_project = new ExtractedCatrobatFile(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/', '/webpath', 'hash'); $id = 'test'; - $this->program_file_repository->zipProject($extracted_program->getPath(), $id); + $this->project_file_repository->zipProject($extracted_project->getPath(), $id); $finder = new Finder(); Assert::assertEquals(1, $finder->files()->in($this->storage_dir)->count()); @@ -90,10 +90,10 @@ public function testReturnsTheFile(): void $id = 'test'; $file = new File($file_name); - $this->program_file_repository->saveProjectZipFile($file, $id); + $this->project_file_repository->saveProjectZipFile($file, $id); $original_md5_sum = md5_file($file->getRealPath()); - $returned_file = $this->program_file_repository->getProjectZipFile($id); + $returned_file = $this->project_file_repository->getProjectZipFile($id); $returned_file_md5_sum = md5_file($returned_file->getRealPath()); Assert::assertEquals($returned_file_md5_sum, $original_md5_sum); diff --git a/tests/PhpUnit/Project/CatrobatFile/ProjectFlavorEventSubscriberTest.php b/tests/PhpUnit/Project/CatrobatFile/ProjectFlavorEventSubscriberTest.php index 8a4c7d9fc6..795eeb7749 100644 --- a/tests/PhpUnit/Project/CatrobatFile/ProjectFlavorEventSubscriberTest.php +++ b/tests/PhpUnit/Project/CatrobatFile/ProjectFlavorEventSubscriberTest.php @@ -2,7 +2,7 @@ namespace Tests\PhpUnit\Project\CatrobatFile; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Project\CatrobatFile\ProjectFlavorEventSubscriber; use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; @@ -16,34 +16,34 @@ */ class ProjectFlavorEventSubscriberTest extends TestCase { - private ProjectFlavorEventSubscriber $program_flavor_listener; + private ProjectFlavorEventSubscriber $project_flavor_listener; private RequestStack $stack; protected function setUp(): void { $this->stack = new RequestStack(); - $this->program_flavor_listener = new ProjectFlavorEventSubscriber($this->stack); + $this->project_flavor_listener = new ProjectFlavorEventSubscriber($this->stack); } public function testInitialization(): void { - $this->assertInstanceOf(ProjectFlavorEventSubscriber::class, $this->program_flavor_listener); + $this->assertInstanceOf(ProjectFlavorEventSubscriber::class, $this->project_flavor_listener); } - public function testSetsTheFlavorOfAProgramBasedOnItsRequestFlavor(): void + public function testSetsTheFlavorOfAProjectBasedOnItsRequestFlavor(): void { - $program = new Program(); + $project = new Project(); $request = new Request(); $request->attributes->set('flavor', 'pocketcode'); $this->stack->push($request); - $this->program_flavor_listener->checkFlavor($program); - Assert::assertEquals('pocketcode', $program->getFlavor()); + $this->project_flavor_listener->checkFlavor($project); + Assert::assertEquals('pocketcode', $project->getFlavor()); $request->attributes->set('flavor', 'pocketphiro'); $this->stack->push($request); - $this->program_flavor_listener->checkFlavor($program); - Assert::assertEquals('pocketphiro', $program->getFlavor()); + $this->project_flavor_listener->checkFlavor($project); + Assert::assertEquals('pocketphiro', $project->getFlavor()); } } diff --git a/tests/PhpUnit/Project/CatrobatFile/ProjectXmlHeaderValidatorEventSubscriberTest.php b/tests/PhpUnit/Project/CatrobatFile/ProjectXmlHeaderValidatorEventSubscriberTest.php index 0a193fc752..c12c77a468 100644 --- a/tests/PhpUnit/Project/CatrobatFile/ProjectXmlHeaderValidatorEventSubscriberTest.php +++ b/tests/PhpUnit/Project/CatrobatFile/ProjectXmlHeaderValidatorEventSubscriberTest.php @@ -15,25 +15,25 @@ */ class ProjectXmlHeaderValidatorEventSubscriberTest extends TestCase { - private ProjectXmlHeaderValidatorEventSubscriber $program_xml_header_validator; + private ProjectXmlHeaderValidatorEventSubscriber $project_xml_header_validator; protected function setUp(): void { - $this->program_xml_header_validator = new ProjectXmlHeaderValidatorEventSubscriber(); + $this->project_xml_header_validator = new ProjectXmlHeaderValidatorEventSubscriber(); } public function testInitialization(): void { - $this->assertInstanceOf(ProjectXmlHeaderValidatorEventSubscriber::class, $this->program_xml_header_validator); + $this->assertInstanceOf(ProjectXmlHeaderValidatorEventSubscriber::class, $this->project_xml_header_validator); } - public function testChecksIfTheProgramXmlHeaderIsValid(): void + public function testChecksIfTheProjectXmlHeaderIsValid(): void { $file = $this->createMock(ExtractedCatrobatFile::class); $xml = simplexml_load_file(BootstrapExtension::$GENERATED_FIXTURES_DIR.'base/code.xml'); $this->assertInstanceOf(\SimpleXMLElement::class, $xml); $file->expects($this->atLeastOnce())->method('getProjectXmlProperties')->willReturn($xml); - $this->program_xml_header_validator->validate($file); + $this->project_xml_header_validator->validate($file); } public function testThrowsAnExceptionIfHeaderIsMissing(): void @@ -44,7 +44,7 @@ public function testThrowsAnExceptionIfHeaderIsMissing(): void unset($xml->header); $file->expects($this->atLeastOnce())->method('getProjectXmlProperties')->willReturn($xml); $this->expectException(InvalidCatrobatFileException::class); - $this->program_xml_header_validator->validate($file); + $this->project_xml_header_validator->validate($file); } public function testThrowsAnExceptionIfHeaderInformationIsMissing(): void @@ -55,10 +55,10 @@ public function testThrowsAnExceptionIfHeaderInformationIsMissing(): void unset($xml->header->applicationName); $file->expects($this->atLeastOnce())->method('getProjectXmlProperties')->willReturn($xml); $this->expectException(InvalidCatrobatFileException::class); - $this->program_xml_header_validator->validate($file); + $this->project_xml_header_validator->validate($file); } - public function testChecksIfProgramNameIsSet(): void + public function testChecksIfProjectNameIsSet(): void { $file = $this->createMock(ExtractedCatrobatFile::class); $xml = simplexml_load_file(BootstrapExtension::$GENERATED_FIXTURES_DIR.'/base/code.xml'); @@ -66,7 +66,7 @@ public function testChecksIfProgramNameIsSet(): void unset($xml->header->programName); $file->expects($this->atLeastOnce())->method('getProjectXmlProperties')->willReturn($xml); $this->expectException(InvalidCatrobatFileException::class); - $this->program_xml_header_validator->validate($file); + $this->project_xml_header_validator->validate($file); } public function testChecksIfDescriptionIsSet(): void @@ -77,6 +77,6 @@ public function testChecksIfDescriptionIsSet(): void unset($xml->header->description); $file->expects($this->atLeastOnce())->method('getProjectXmlProperties')->willReturn($xml); $this->expectException(InvalidCatrobatFileException::class); - $this->program_xml_header_validator->validate($file); + $this->project_xml_header_validator->validate($file); } } diff --git a/tests/PhpUnit/Project/Extension/ProjectExtensionManagerTest.php b/tests/PhpUnit/Project/Extension/ProjectExtensionManagerTest.php index d67b1fec63..13a0ae33c1 100644 --- a/tests/PhpUnit/Project/Extension/ProjectExtensionManagerTest.php +++ b/tests/PhpUnit/Project/Extension/ProjectExtensionManagerTest.php @@ -2,7 +2,7 @@ namespace Project\Extension; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\Project\CatrobatFile\ExtractedCatrobatFile; use App\Project\Extension\ProjectExtensionManager; use App\System\Testing\PhpUnit\DefaultTestCase; @@ -42,8 +42,8 @@ protected function setUp(): void */ public function testAddExtensions(): void { - $program = $this - ->getMockBuilder(Program::class) + $project = $this + ->getMockBuilder(Project::class) ->onlyMethods(['removeAllExtensions']) ->getMockForAbstractClass() ; @@ -62,7 +62,7 @@ public function testAddExtensions(): void ->getMockForAbstractClass() ; - $program->expects($this->once())->method('removeAllExtensions'); + $project->expects($this->once())->method('removeAllExtensions'); $this->object->expects($this->once())->method('addArduinoExtensions'); $this->object->expects($this->once())->method('addPhiroExtensions'); $this->object->expects($this->once())->method('addEmbroideryExtensions'); @@ -70,7 +70,7 @@ public function testAddExtensions(): void $this->object->expects($this->once())->method('addMultiplayerExtensions'); $this->object->expects($this->once())->method('saveProject'); - $this->object->addExtensions($this->extracted_catrobat_file_with_extensions, $program); + $this->object->addExtensions($this->extracted_catrobat_file_with_extensions, $project); } /** diff --git a/tests/PhpUnit/Project/ProjectManagerTest.php b/tests/PhpUnit/Project/ProjectManagerTest.php index d6a803fb99..fd20b2b78c 100644 --- a/tests/PhpUnit/Project/ProjectManagerTest.php +++ b/tests/PhpUnit/Project/ProjectManagerTest.php @@ -2,11 +2,11 @@ namespace Tests\PhpUnit\Project; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; use App\DB\EntityRepository\Project\ExtensionRepository; -use App\DB\EntityRepository\Project\ProgramLikeRepository; -use App\DB\EntityRepository\Project\ProgramRepository; +use App\DB\EntityRepository\Project\ProjectLikeRepository; +use App\DB\EntityRepository\Project\ProjectRepository; use App\DB\EntityRepository\Project\Special\ExampleRepository; use App\DB\EntityRepository\Project\Special\FeaturedRepository; use App\DB\EntityRepository\Project\TagRepository; @@ -41,7 +41,7 @@ */ class ProjectManagerTest extends TestCase { - private ProjectManager $program_manager; + private ProjectManager $project_manager; private MockObject|ProjectFileRepository $file_repository; @@ -55,9 +55,9 @@ class ProjectManagerTest extends TestCase private ExtractedCatrobatFile|MockObject $extracted_file; - private MockObject|ProjectBeforeInsertEvent $programBeforeInsertEvent; + private MockObject|ProjectBeforeInsertEvent $projectBeforeInsertEvent; - private MockObject|ProjectAfterInsertEvent $programAfterInsertEvent; + private MockObject|ProjectAfterInsertEvent $projectAfterInsertEvent; /** * @throws \Exception @@ -68,32 +68,32 @@ protected function setUp(): void $this->file_repository = $this->createMock(ProjectFileRepository::class); $this->screenshot_repository = $this->createMock(ScreenshotRepository::class); $this->entity_manager = $this->createMock(EntityManager::class); - $program_repository = $this->createMock(ProgramRepository::class); + $project_repository = $this->createMock(ProjectRepository::class); $this->event_dispatcher = $this->createMock(EventDispatcherInterface::class); $this->request = $this->createMock(AddProjectRequest::class); $user = $this->createMock(User::class); $this->extracted_file = $this->createMock(ExtractedCatrobatFile::class); - $inserted_program = $this->createMock(Program::class); + $inserted_project = $this->createMock(Project::class); $tag_repository = $this->createMock(TagRepository::class); - $program_like_repository = $this->createMock(ProgramLikeRepository::class); + $project_like_repository = $this->createMock(ProjectLikeRepository::class); $featured_repository = $this->createMock(FeaturedRepository::class); $example_repository = $this->createMock(ExampleRepository::class); $logger = $this->createMock(LoggerInterface::class); $app_request = $this->createMock(RequestHelper::class); - $this->programBeforeInsertEvent = $this->createMock(ProjectBeforeInsertEvent::class); - $this->programAfterInsertEvent = $this->createMock(ProjectAfterInsertEvent::class); + $this->projectBeforeInsertEvent = $this->createMock(ProjectBeforeInsertEvent::class); + $this->projectAfterInsertEvent = $this->createMock(ProjectAfterInsertEvent::class); $extension_repository = $this->createMock(ExtensionRepository::class); $catrobat_file_sanitizer = $this->createMock(CatrobatFileSanitizer::class); $notification_service = $this->createMock(NotificationManager::class); - $program_finder = $this->createMock(TransformedFinder::class); + $project_finder = $this->createMock(TransformedFinder::class); $url_helper = new UrlHelper(new RequestStack()); $security = $this->createMock(Security::class); - $this->program_manager = new ProjectManager( + $this->project_manager = new ProjectManager( $file_extractor, $this->file_repository, $this->screenshot_repository, - $this->entity_manager, $program_repository, $tag_repository, $program_like_repository, $featured_repository, + $this->entity_manager, $project_repository, $tag_repository, $project_like_repository, $featured_repository, $example_repository, $this->event_dispatcher, $logger, $app_request, $extension_repository, - $catrobat_file_sanitizer, $notification_service, $program_finder, $url_helper, $security + $catrobat_file_sanitizer, $notification_service, $project_finder, $url_helper, $security ); $this->extracted_file->expects($this->any())->method('getName')->willReturn('TestProject'); @@ -112,48 +112,48 @@ protected function setUp(): void $this->request->expects($this->any())->method('getLanguage')->willReturn('en'); $this->request->expects($this->any())->method('getFlavor')->willReturn('pocketcode'); $file_extractor->expects($this->any())->method('extract')->with($file)->willReturn($this->extracted_file); - $inserted_program->expects($this->any())->method('getId')->willReturn('1'); + $inserted_project->expects($this->any())->method('getId')->willReturn('1'); - $this->programBeforeInsertEvent->expects($this->any())->method('isPropagationStopped')->willReturn(false); + $this->projectBeforeInsertEvent->expects($this->any())->method('isPropagationStopped')->willReturn(false); } public function testInitialization(): void { - $this->assertInstanceOf(ProjectManager::class, $this->program_manager); + $this->assertInstanceOf(ProjectManager::class, $this->project_manager); } /** * @throws \Exception */ - public function testReturnsTheProgramAfterSuccessfullyAddingAProgram(): void + public function testReturnsTheProjectAfterSuccessfullyAddingAProject(): void { - $func = function (Program $project): Program { + $func = function (Project $project): Project { $project->setId('1'); return $project; }; - $this->entity_manager->expects($this->atLeastOnce())->method('persist')->with($this->isInstanceOf(Program::class)) + $this->entity_manager->expects($this->atLeastOnce())->method('persist')->with($this->isInstanceOf(Project::class)) ->will($this->returnCallback($func)) ; $this->entity_manager->expects($this->atLeastOnce())->method('flush'); $this->entity_manager->expects($this->atLeastOnce())->method('refresh') - ->with($this->isInstanceOf(Program::class)) + ->with($this->isInstanceOf(Project::class)) ; $this->event_dispatcher->expects($this->atLeastOnce())->method('dispatch') - ->willReturn($this->programBeforeInsertEvent) + ->willReturn($this->projectBeforeInsertEvent) ; - $this->assertInstanceOf(Program::class, $this->program_manager->addProject($this->request)); + $this->assertInstanceOf(Project::class, $this->project_manager->addProject($this->request)); } /** * @throws \Exception */ - public function testSavesTheProgramToTheFileRepositoryIfTheUploadSucceeded(): void + public function testSavesTheProjectToTheFileRepositoryIfTheUploadSucceeded(): void { $this->entity_manager->expects($this->atLeastOnce())->method('persist') - ->will($this->returnCallback(function (Program $project): Program { + ->will($this->returnCallback(function (Project $project): Project { $project->setId('1'); return $project; @@ -163,11 +163,11 @@ public function testSavesTheProgramToTheFileRepositoryIfTheUploadSucceeded(): vo $file = new File('/tmp/PhpUnitTest'); $this->file_repository->expects($this->atLeastOnce())->method('saveProjectZipFile')->with($file, 1); $this->entity_manager->expects($this->atLeastOnce())->method('flush'); - $this->entity_manager->expects($this->atLeastOnce())->method('refresh')->with($this->isInstanceOf(Program::class)); + $this->entity_manager->expects($this->atLeastOnce())->method('refresh')->with($this->isInstanceOf(Project::class)); - $this->event_dispatcher->expects($this->atLeastOnce())->method('dispatch')->willReturn($this->programBeforeInsertEvent); + $this->event_dispatcher->expects($this->atLeastOnce())->method('dispatch')->willReturn($this->projectBeforeInsertEvent); - $this->program_manager->addProject($this->request); + $this->project_manager->addProject($this->request); } /** @@ -181,7 +181,7 @@ public function testSavesTheScreenshotsToTheScreenshotRepository(): void $this->extracted_file->expects($this->atLeastOnce())->method('getTags')->willReturn([]); $this->extracted_file->expects($this->atLeastOnce())->method('isDebugBuild')->willReturn(false); $this->entity_manager->expects($this->atLeastOnce())->method('persist') - ->will($this->returnCallback(function (Program $project): Program { + ->will($this->returnCallback(function (Project $project): Project { $project->setId('1'); return $project; @@ -189,7 +189,7 @@ public function testSavesTheScreenshotsToTheScreenshotRepository(): void ; $this->entity_manager->expects($this->atLeastOnce())->method('flush'); $this->entity_manager->expects($this->atLeastOnce()) - ->method('refresh')->with($this->isInstanceOf(Program::class)) + ->method('refresh')->with($this->isInstanceOf(Project::class)) ; $this->screenshot_repository->expects($this->atLeastOnce()) @@ -199,17 +199,17 @@ public function testSavesTheScreenshotsToTheScreenshotRepository(): void ->method('makeTempProjectAssetsPerm')->with(1) ; - $this->event_dispatcher->expects($this->atLeastOnce())->method('dispatch')->willReturn($this->programBeforeInsertEvent); + $this->event_dispatcher->expects($this->atLeastOnce())->method('dispatch')->willReturn($this->projectBeforeInsertEvent); - $this->program_manager->addProject($this->request); + $this->project_manager->addProject($this->request); } /** * @throws \Exception */ - public function testFiresAnEventBeforeInsertingAProgram(): void + public function testFiresAnEventBeforeInsertingAProject(): void { - $func = function (Program $project): Program { + $func = function (Project $project): Project { $project->setId('1'); return $project; @@ -221,20 +221,20 @@ public function testFiresAnEventBeforeInsertingAProgram(): void $this->entity_manager->expects($this->atLeastOnce())->method('flush'); $this->entity_manager->expects($this->atLeastOnce())->method('refresh') - ->with($this->isInstanceOf(Program::class)) + ->with($this->isInstanceOf(Project::class)) ; $this->event_dispatcher->expects($this->atLeastOnce())->method('dispatch') - ->willReturn($this->programBeforeInsertEvent) + ->willReturn($this->projectBeforeInsertEvent) ; - $this->assertInstanceOf(Program::class, $this->program_manager->addProject($this->request)); + $this->assertInstanceOf(Project::class, $this->project_manager->addProject($this->request)); } /** * @throws \Exception */ - public function testFiresAnEventWhenTheProgramIsInvalid(): void + public function testFiresAnEventWhenTheProjectIsInvalid(): void { $validation_exception = new InvalidCatrobatFileException('500', 500); @@ -246,16 +246,16 @@ public function testFiresAnEventWhenTheProgramIsInvalid(): void ->will($this->throwException($validation_exception)) ; - $this->program_manager->addProject($this->request); + $this->project_manager->addProject($this->request); } /** * @throws \Exception */ - public function testFiresAnEventWhenTheProgramIsStored(): void + public function testFiresAnEventWhenTheProjectIsStored(): void { $this->entity_manager->expects($this->atLeastOnce())->method('persist') - ->will($this->returnCallback(function (Program $project): Program { + ->will($this->returnCallback(function (Project $project): Project { $project->setId('1'); return $project; @@ -264,15 +264,15 @@ public function testFiresAnEventWhenTheProgramIsStored(): void $this->entity_manager->expects($this->atLeastOnce())->method('flush'); $this->entity_manager->expects($this->atLeastOnce())->method('refresh') - ->with($this->isInstanceOf(Program::class)) + ->with($this->isInstanceOf(Project::class)) ; - $this->event_dispatcher->expects($this->atLeastOnce())->method('dispatch')->willReturn($this->programBeforeInsertEvent); + $this->event_dispatcher->expects($this->atLeastOnce())->method('dispatch')->willReturn($this->projectBeforeInsertEvent); $this->event_dispatcher->expects($this->atLeastOnce())->method('dispatch') - ->willReturn($this->onConsecutiveCalls($this->programBeforeInsertEvent, $this->createMock(ProjectBeforePersistEvent::class), $this->programAfterInsertEvent)) + ->willReturn($this->onConsecutiveCalls($this->projectBeforeInsertEvent, $this->createMock(ProjectBeforePersistEvent::class), $this->projectAfterInsertEvent)) ; - $this->assertInstanceOf(Program::class, $this->program_manager->addProject($this->request)); + $this->assertInstanceOf(Project::class, $this->project_manager->addProject($this->request)); } } diff --git a/tests/PhpUnit/Project/Remix/RemixManagerTest.php b/tests/PhpUnit/Project/Remix/RemixManagerTest.php index c215e4642b..56a638c98e 100644 --- a/tests/PhpUnit/Project/Remix/RemixManagerTest.php +++ b/tests/PhpUnit/Project/Remix/RemixManagerTest.php @@ -2,16 +2,16 @@ namespace Tests\PhpUnit\Project\Remix; -use App\DB\Entity\Project\Program; -use App\DB\Entity\Project\Remix\ProgramRemixRelation; -use App\DB\Entity\Project\Scratch\ScratchProgram; -use App\DB\Entity\Project\Scratch\ScratchProgramRemixRelation; +use App\DB\Entity\Project\Project; +use App\DB\Entity\Project\Remix\ProjectRemixRelation; +use App\DB\Entity\Project\Scratch\ScratchProject; +use App\DB\Entity\Project\Scratch\ScratchProjectRemixRelation; use App\DB\Entity\User\User; -use App\DB\EntityRepository\Project\ProgramRemixBackwardRepository; -use App\DB\EntityRepository\Project\ProgramRemixRepository; -use App\DB\EntityRepository\Project\ProgramRepository; -use App\DB\EntityRepository\Project\ScratchProgramRemixRepository; -use App\DB\EntityRepository\Project\ScratchProgramRepository; +use App\DB\EntityRepository\Project\ProjectRemixBackwardRepository; +use App\DB\EntityRepository\Project\ProjectRemixRepository; +use App\DB\EntityRepository\Project\ProjectRepository; +use App\DB\EntityRepository\Project\ScratchProjectRemixRepository; +use App\DB\EntityRepository\Project\ScratchProjectRepository; use App\Project\Remix\RemixData; use App\Project\Remix\RemixGraphManipulator; use App\Project\Remix\RemixManager; @@ -32,23 +32,23 @@ class RemixManagerTest extends TestCase private EntityManager|MockObject $entity_manager; - private MockObject|ProgramRepository $program_repository; + private MockObject|ProjectRepository $project_repository; - private MockObject|ScratchProgramRepository $scratch_program_repository; + private MockObject|ScratchProjectRepository $scratch_project_repository; - private MockObject|ProgramRemixRepository $program_remix_repository; + private MockObject|ProjectRemixRepository $project_remix_repository; protected function setUp(): void { $this->entity_manager = $this->createMock(EntityManager::class); - $this->program_repository = $this->createMock(ProgramRepository::class); - $this->scratch_program_repository = $this->createMock(ScratchProgramRepository::class); - $this->program_remix_repository = $this->createMock(ProgramRemixRepository::class); - $program_remix_backward_repository = $this->createMock(ProgramRemixBackwardRepository::class); - $scratch_program_remix_repository = $this->createMock(ScratchProgramRemixRepository::class); + $this->project_repository = $this->createMock(ProjectRepository::class); + $this->scratch_project_repository = $this->createMock(ScratchProjectRepository::class); + $this->project_remix_repository = $this->createMock(ProjectRemixRepository::class); + $project_remix_backward_repository = $this->createMock(ProjectRemixBackwardRepository::class); + $scratch_project_remix_repository = $this->createMock(ScratchProjectRemixRepository::class); $remix_graph_manipulator = $this->createMock(RemixGraphManipulator::class); $catro_notification_service = $this->createMock(NotificationManager::class); - $this->remix_manager = new RemixManager($this->entity_manager, $this->program_repository, $this->scratch_program_repository, $this->program_remix_repository, $program_remix_backward_repository, $scratch_program_remix_repository, $remix_graph_manipulator, $catro_notification_service); + $this->remix_manager = new RemixManager($this->entity_manager, $this->project_repository, $this->scratch_project_repository, $this->project_remix_repository, $project_remix_backward_repository, $scratch_project_remix_repository, $remix_graph_manipulator, $catro_notification_service); } public function testInitialization(): void @@ -59,37 +59,37 @@ public function testInitialization(): void /** * @throws \Exception */ - public function testAddSingleScratchProgram(): void + public function testAddSingleScratchProject(): void { - $expected_id_of_first_program = '123'; - $expected_name_of_first_program = 'Test program'; - $expected_description_of_first_program = 'My description'; - $expected_username_of_first_program = 'John Doe'; - $scratch_info_data = [$expected_id_of_first_program => [ - 'id' => $expected_id_of_first_program, - 'creator' => ['username' => $expected_username_of_first_program], - 'title' => $expected_name_of_first_program, - 'description' => $expected_description_of_first_program, + $expected_id_of_first_project = '123'; + $expected_name_of_first_project = 'Test program'; + $expected_description_of_first_project = 'My description'; + $expected_username_of_first_project = 'John Doe'; + $scratch_info_data = [$expected_id_of_first_project => [ + 'id' => $expected_id_of_first_project, + 'creator' => ['username' => $expected_username_of_first_project], + 'title' => $expected_name_of_first_project, + 'description' => $expected_description_of_first_project, ]]; - $this->scratch_program_repository + $this->scratch_project_repository ->expects($this->atLeastOnce()) - ->method('find')->with($expected_id_of_first_program) + ->method('find')->with($expected_id_of_first_project) ->willReturn(null) ; $this->entity_manager ->expects($this->atLeastOnce()) - ->method('persist')->with($this->isInstanceOf(ScratchProgram::class)) - ->will($this->returnCallback(function (ScratchProgram $scratch_project) use ( - $expected_id_of_first_program, $expected_name_of_first_program, - $expected_description_of_first_program, $expected_username_of_first_program + ->method('persist')->with($this->isInstanceOf(ScratchProject::class)) + ->will($this->returnCallback(function (ScratchProject $scratch_project) use ( + $expected_id_of_first_project, $expected_name_of_first_project, + $expected_description_of_first_project, $expected_username_of_first_project ) { - $this->assertInstanceOf(ScratchProgram::class, $scratch_project); - $this->assertSame($expected_id_of_first_program, $scratch_project->getId()); - $this->assertSame($expected_name_of_first_program, $scratch_project->getName()); - $this->assertSame($expected_description_of_first_program, $scratch_project->getDescription()); - $this->assertSame($expected_username_of_first_program, $scratch_project->getUsername()); + $this->assertInstanceOf(ScratchProject::class, $scratch_project); + $this->assertSame($expected_id_of_first_project, $scratch_project->getId()); + $this->assertSame($expected_name_of_first_project, $scratch_project->getName()); + $this->assertSame($expected_description_of_first_project, $scratch_project->getDescription()); + $this->assertSame($expected_username_of_first_project, $scratch_project->getUsername()); })) ; $this->entity_manager->expects($this->atLeastOnce())->method('flush'); @@ -99,23 +99,23 @@ public function testAddSingleScratchProgram(): void /** * @throws \Exception */ - public function testAddSingleScratchProgramWithMissingData(): void + public function testAddSingleScratchProjectWithMissingData(): void { - $expected_id_of_first_program = '123'; - $scratch_info_data = [$expected_id_of_first_program => []]; + $expected_id_of_first_project = '123'; + $scratch_info_data = [$expected_id_of_first_project => []]; - $this->scratch_program_repository + $this->scratch_project_repository ->expects($this->atLeastOnce()) - ->method('find')->with($expected_id_of_first_program) + ->method('find')->with($expected_id_of_first_project) ->willReturn(null) ; $this->entity_manager ->expects($this->atLeastOnce()) - ->method('persist')->with($this->isInstanceOf(ScratchProgram::class)) - ->will($this->returnCallback(function (ScratchProgram $scratch_project) use ($expected_id_of_first_program) { - $this->assertInstanceOf(ScratchProgram::class, $scratch_project); - $this->assertSame($expected_id_of_first_program, $scratch_project->getId()); + ->method('persist')->with($this->isInstanceOf(ScratchProject::class)) + ->will($this->returnCallback(function (ScratchProject $scratch_project) use ($expected_id_of_first_project) { + $this->assertInstanceOf(ScratchProject::class, $scratch_project); + $this->assertSame($expected_id_of_first_project, $scratch_project->getId()); $this->assertNull($scratch_project->getName()); $this->assertNull($scratch_project->getDescription()); $this->assertNull($scratch_project->getUsername()); @@ -129,29 +129,29 @@ public function testAddSingleScratchProgramWithMissingData(): void /** * @throws \Exception */ - public function testAddMultipleScratchPrograms(): void + public function testAddMultipleScratchProjects(): void { - $expected_id_of_first_program = '123'; - $expected_name_of_first_program = 'Test program'; - $expected_description_of_first_program = 'My description'; - $expected_username_of_first_program = 'John Doe'; - $expected_id_of_second_program = '121'; - $expected_name_of_second_program = 'Other test program'; - $expected_username_of_second_program = 'Chuck Norris'; + $expected_id_of_first_project = '123'; + $expected_name_of_first_project = 'Test program'; + $expected_description_of_first_project = 'My description'; + $expected_username_of_first_project = 'John Doe'; + $expected_id_of_second_project = '121'; + $expected_name_of_second_project = 'Other test program'; + $expected_username_of_second_project = 'Chuck Norris'; $scratch_info_data = [ - $expected_id_of_first_program => [ - 'id' => $expected_id_of_first_program, - 'creator' => ['username' => $expected_username_of_first_program], - 'title' => $expected_name_of_first_program, - 'description' => $expected_description_of_first_program, - ], $expected_id_of_second_program => [ - 'id' => $expected_id_of_second_program, - 'creator' => ['username' => $expected_username_of_second_program], - 'title' => $expected_name_of_second_program, + $expected_id_of_first_project => [ + 'id' => $expected_id_of_first_project, + 'creator' => ['username' => $expected_username_of_first_project], + 'title' => $expected_name_of_first_project, + 'description' => $expected_description_of_first_project, + ], $expected_id_of_second_project => [ + 'id' => $expected_id_of_second_project, + 'creator' => ['username' => $expected_username_of_second_project], + 'title' => $expected_name_of_second_project, ], ]; - $this->scratch_program_repository + $this->scratch_project_repository ->expects($this->exactly(2)) ->method('find') ->willReturn(null) @@ -159,21 +159,21 @@ public function testAddMultipleScratchPrograms(): void $this->entity_manager ->expects($this->atLeastOnce()) - ->method('persist')->with($this->isInstanceOf(ScratchProgram::class)) - ->will($this->returnCallback(function (ScratchProgram $scratch_project) use ( - $expected_id_of_first_program, $expected_name_of_first_program, - $expected_description_of_first_program, $expected_username_of_first_program, - $expected_id_of_second_program, $expected_name_of_second_program, $expected_username_of_second_program + ->method('persist')->with($this->isInstanceOf(ScratchProject::class)) + ->will($this->returnCallback(function (ScratchProject $scratch_project) use ( + $expected_id_of_first_project, $expected_name_of_first_project, + $expected_description_of_first_project, $expected_username_of_first_project, + $expected_id_of_second_project, $expected_name_of_second_project, $expected_username_of_second_project ) { - $this->assertInstanceOf(ScratchProgram::class, $scratch_project); - if ($scratch_project->getId() === $expected_id_of_first_program) { - $this->assertSame($expected_name_of_first_program, $scratch_project->getName()); - $this->assertSame($expected_description_of_first_program, $scratch_project->getDescription()); - $this->assertSame($expected_username_of_first_program, $scratch_project->getUsername()); - } elseif ($scratch_project->getId() === $expected_id_of_second_program) { - $this->assertSame($expected_name_of_second_program, $scratch_project->getName()); + $this->assertInstanceOf(ScratchProject::class, $scratch_project); + if ($scratch_project->getId() === $expected_id_of_first_project) { + $this->assertSame($expected_name_of_first_project, $scratch_project->getName()); + $this->assertSame($expected_description_of_first_project, $scratch_project->getDescription()); + $this->assertSame($expected_username_of_first_project, $scratch_project->getUsername()); + } elseif ($scratch_project->getId() === $expected_id_of_second_project) { + $this->assertSame($expected_name_of_second_project, $scratch_project->getName()); $this->assertNull($scratch_project->getDescription()); - $this->assertSame($expected_username_of_second_program, $scratch_project->getUsername()); + $this->assertSame($expected_username_of_second_project, $scratch_project->getUsername()); } })) ; @@ -185,38 +185,38 @@ public function testAddMultipleScratchPrograms(): void /** * @throws \Exception */ - public function testSetProgramAsRootAndDontAddRemixRelationsWhenNoParentsAreGiven(): void + public function testSetProjectAsRootAndDontAddRemixRelationsWhenNoParentsAreGiven(): void { - $program_entity = $this->createMock(Program::class); - $program_entity->expects($this->atLeastOnce())->method('getId')->willReturn('123'); - $program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); + $project_entity = $this->createMock(Project::class); + $project_entity->expects($this->atLeastOnce())->method('getId')->willReturn('123'); + $project_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); $parent_data = []; $expected_relations = [ - new ProgramRemixRelation($program_entity, $program_entity, 0), + new ProjectRemixRelation($project_entity, $project_entity, 0), ]; - $this->checkRemixRelations($program_entity, $parent_data, $expected_relations); - $this->assertTrue($program_entity->isRemixRoot()); + $this->checkRemixRelations($project_entity, $parent_data, $expected_relations); + $this->assertTrue($project_entity->isRemixRoot()); } /** * @throws \Exception */ - public function testSetProgramAsRootAndDontAddRemixRelationsForNonExistingParents(): void + public function testSetProjectAsRootAndDontAddRemixRelationsForNonExistingParents(): void { - $program_entity = $this->createMock(Program::class); - $program_entity->expects($this->atLeastOnce())->method('getId')->willReturn('123'); - $program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); + $project_entity = $this->createMock(Project::class); + $project_entity->expects($this->atLeastOnce())->method('getId')->willReturn('123'); + $project_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); - $first_parent_entity = $this->createMock(Program::class); + $first_parent_entity = $this->createMock(Project::class); $first_parent_entity->expects($this->atLeastOnce())->method('getId')->willReturn('3570'); $first_parent_entity->expects($this->any()) ->method('getUser') ->willReturn($this->createMock(User::class)) ; - $second_parent_entity = $this->createMock(Program::class); + $second_parent_entity = $this->createMock(Project::class); $second_parent_entity->expects($this->atLeastOnce())->method('getId')->willReturn('16267'); $second_parent_entity->expects($this->any()) ->method('getUser') @@ -238,17 +238,17 @@ public function testSetProgramAsRootAndDontAddRemixRelationsForNonExistingParent ], ]; $expected_relations = [ - new ProgramRemixRelation($program_entity, $program_entity, 0), + new ProjectRemixRelation($project_entity, $project_entity, 0), ]; - $this->checkRemixRelations($program_entity, $parent_data, $expected_relations); - $this->assertTrue($program_entity->isRemixRoot()); + $this->checkRemixRelations($project_entity, $parent_data, $expected_relations); + $this->assertTrue($project_entity->isRemixRoot()); } /** * @throws \Exception */ - public function testSetProgramAsRootIfOnlyHasScratchParents(): void + public function testSetProjectAsRootIfOnlyHasScratchParents(): void { // -------------------------------------------------------------------------------------------------------------- // @@ -259,14 +259,14 @@ public function testSetProgramAsRootIfOnlyHasScratchParents(): void // (123) <--------- to be added // // -------------------------------------------------------------------------------------------------------------- - $program_entity = $this->createMock(Program::class); - $program_entity->expects($this->atLeastOnce()) + $project_entity = $this->createMock(Project::class); + $project_entity->expects($this->atLeastOnce()) ->method('getId')->willReturn('123') ; - $program_entity->expects($this->atLeastOnce()) + $project_entity->expects($this->atLeastOnce()) ->method('isInitialVersion')->willReturn(true) ; - $program_entity->expects($this->any()) + $project_entity->expects($this->any()) ->method('getUser') ->willReturn($this->createMock(User::class)) ; @@ -287,13 +287,13 @@ public function testSetProgramAsRootIfOnlyHasScratchParents(): void ], ]; $expected_relations = [ - new ProgramRemixRelation($program_entity, $program_entity, 0), - new ScratchProgramRemixRelation($first_scratch_parent_id, $program_entity), - new ScratchProgramRemixRelation($second_scratch_parent_id, $program_entity), + new ProjectRemixRelation($project_entity, $project_entity, 0), + new ScratchProjectRemixRelation($first_scratch_parent_id, $project_entity), + new ScratchProjectRemixRelation($second_scratch_parent_id, $project_entity), ]; - $this->checkRemixRelations($program_entity, $parent_data, $expected_relations); - $this->assertTrue($program_entity->isRemixRoot()); + $this->checkRemixRelations($project_entity, $parent_data, $expected_relations); + $this->assertTrue($project_entity->isRemixRoot()); } /** @@ -309,16 +309,16 @@ public function testAddRemixRelationsForOnlyOneExistingParent(): void // // -------------------------------------------------------------------------------------------------------------- - $program_entities = $this->getProgramEntityAndParents('2'); + $project_entities = $this->getProjectEntityAndParents('2'); - /** @var Program $program_entity */ - $program_entity = $program_entities[0]; + /** @var Project $project_entity */ + $project_entity = $project_entities[0]; - /** @var Program $first_parent_entity */ - $first_parent_entity = $program_entities[1]; + /** @var Project $first_parent_entity */ + $first_parent_entity = $project_entities[1]; - /** @var Program $second_parent_entity */ - $second_parent_entity = $program_entities[2]; + /** @var Project $second_parent_entity */ + $second_parent_entity = $project_entities[2]; $parent_data = [ $first_parent_entity->getId() ?? '' => [ @@ -335,11 +335,11 @@ public function testAddRemixRelationsForOnlyOneExistingParent(): void ], ]; $expected_relations = [ - new ProgramRemixRelation($program_entity, $program_entity, 0), - new ProgramRemixRelation($second_parent_entity, $program_entity, 1), + new ProjectRemixRelation($project_entity, $project_entity, 0), + new ProjectRemixRelation($second_parent_entity, $project_entity, 1), ]; - $this->checkRemixRelations($program_entity, $parent_data, $expected_relations); - $this->assertFalse($program_entity->isRemixRoot()); + $this->checkRemixRelations($project_entity, $parent_data, $expected_relations); + $this->assertFalse($project_entity->isRemixRoot()); } /** @@ -354,13 +354,13 @@ public function testAddRemixRelationsForExistingParents(): void // (123) <--------- to be added // // -------------------------------------------------------------------------------------------------------------- - $program_entities = $this->getProgramEntityAndParents(); + $project_entities = $this->getProjectEntityAndParents(); - $program_entity = $program_entities[0]; + $project_entity = $project_entities[0]; - $first_parent_entity = $program_entities[1]; + $first_parent_entity = $project_entities[1]; - $second_parent_entity = $program_entities[2]; + $second_parent_entity = $project_entities[2]; $parent_data = [ $first_parent_entity->getId() => [ @@ -377,12 +377,12 @@ public function testAddRemixRelationsForExistingParents(): void ], ]; $expected_relations = [ - new ProgramRemixRelation($program_entity, $program_entity, 0), - new ProgramRemixRelation($first_parent_entity, $program_entity, 1), - new ProgramRemixRelation($second_parent_entity, $program_entity, 1), + new ProjectRemixRelation($project_entity, $project_entity, 0), + new ProjectRemixRelation($first_parent_entity, $project_entity, 1), + new ProjectRemixRelation($second_parent_entity, $project_entity, 1), ]; - $this->checkRemixRelations($program_entity, $parent_data, $expected_relations); - $this->assertFalse($program_entity->isRemixRoot()); + $this->checkRemixRelations($project_entity, $parent_data, $expected_relations); + $this->assertFalse($project_entity->isRemixRoot()); } /** @@ -399,7 +399,7 @@ public function testAddRemixRelationsForExistingParentsSharingSameParent(): void // // -------------------------------------------------------------------------------------------------------------- - $parent_entity_of_both_parents = $this->createMock(Program::class); + $parent_entity_of_both_parents = $this->createMock(Project::class); $parent_entity_of_both_parents->expects($this->atLeastOnce()) ->method('getId')->willReturn('1') ; @@ -408,8 +408,8 @@ public function testAddRemixRelationsForExistingParentsSharingSameParent(): void ->willReturn($this->createMock(User::class)) ; - $entities = $this->getProgramEntityAndParents('4', '2', '3'); - $program_entity = $entities[0]; + $entities = $this->getProjectEntityAndParents('4', '2', '3'); + $project_entity = $entities[0]; $first_parent_entity = $entities[1]; $second_parent_entity = $entities[2]; @@ -419,8 +419,8 @@ public function testAddRemixRelationsForExistingParentsSharingSameParent(): void 'entity' => $first_parent_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($first_parent_entity, $first_parent_entity, 0), - new ProgramRemixRelation($parent_entity_of_both_parents, $first_parent_entity, 1), + new ProjectRemixRelation($first_parent_entity, $first_parent_entity, 0), + new ProjectRemixRelation($parent_entity_of_both_parents, $first_parent_entity, 1), ], ], $second_parent_entity->getId() => [ @@ -428,25 +428,25 @@ public function testAddRemixRelationsForExistingParentsSharingSameParent(): void 'entity' => $second_parent_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($second_parent_entity, $second_parent_entity, 0), - new ProgramRemixRelation($parent_entity_of_both_parents, $second_parent_entity, 1), + new ProjectRemixRelation($second_parent_entity, $second_parent_entity, 0), + new ProjectRemixRelation($parent_entity_of_both_parents, $second_parent_entity, 1), ], ], ]; $expected_relations = [ // self-relation - new ProgramRemixRelation($program_entity, $program_entity, 0), + new ProjectRemixRelation($project_entity, $project_entity, 0), // relation to parents - new ProgramRemixRelation($first_parent_entity, $program_entity, 1), - new ProgramRemixRelation($second_parent_entity, $program_entity, 1), + new ProjectRemixRelation($first_parent_entity, $project_entity, 1), + new ProjectRemixRelation($second_parent_entity, $project_entity, 1), // relation to grandparents - new ProgramRemixRelation($parent_entity_of_both_parents, $program_entity, 2), + new ProjectRemixRelation($parent_entity_of_both_parents, $project_entity, 2), ]; - $this->checkRemixRelations($program_entity, $parent_data, $expected_relations); - $this->assertFalse($program_entity->isRemixRoot()); + $this->checkRemixRelations($project_entity, $parent_data, $expected_relations); + $this->assertFalse($project_entity->isRemixRoot()); } /** @@ -462,7 +462,7 @@ public function testAddRemixRelationsForExistingParentsHavingDifferentParent(): // (5) <--------- to be added // // -------------------------------------------------------------------------------------------------------------- - $parent_entity_of_first_parent = $this->createMock(Program::class); + $parent_entity_of_first_parent = $this->createMock(Project::class); $parent_entity_of_first_parent->expects($this->atLeastOnce()) ->method('getId')->willReturn('1') ; @@ -470,7 +470,7 @@ public function testAddRemixRelationsForExistingParentsHavingDifferentParent(): ->method('getUser') ->willReturn($this->createMock(User::class)) ; - $parent_entity_of_second_parent = $this->createMock(Program::class); + $parent_entity_of_second_parent = $this->createMock(Project::class); $parent_entity_of_second_parent->expects($this->atLeastOnce()) ->method('getId')->willReturn('2') ; @@ -478,7 +478,7 @@ public function testAddRemixRelationsForExistingParentsHavingDifferentParent(): ->method('getUser') ->willReturn($this->createMock(User::class)) ; - $first_parent_entity = $this->createMock(Program::class); + $first_parent_entity = $this->createMock(Project::class); $first_parent_entity->expects($this->atLeastOnce()) ->method('getId')->willReturn('3') ; @@ -486,7 +486,7 @@ public function testAddRemixRelationsForExistingParentsHavingDifferentParent(): ->method('getUser') ->willReturn($this->createMock(User::class)) ; - $second_parent_entity = $this->createMock(Program::class); + $second_parent_entity = $this->createMock(Project::class); $second_parent_entity->expects($this->atLeastOnce()) ->method('getId')->willReturn('4') ; @@ -494,14 +494,14 @@ public function testAddRemixRelationsForExistingParentsHavingDifferentParent(): ->method('getUser') ->willReturn($this->createMock(User::class)) ; - $program_entity = $this->createMock(Program::class); - $program_entity->expects($this->atLeastOnce()) + $project_entity = $this->createMock(Project::class); + $project_entity->expects($this->atLeastOnce()) ->method('getId')->willReturn('5') ; - $program_entity->expects($this->atLeastOnce()) + $project_entity->expects($this->atLeastOnce()) ->method('isInitialVersion')->willReturn(true) ; - $program_entity->expects($this->any()) + $project_entity->expects($this->any()) ->method('getUser') ->willReturn($this->createMock(User::class)) ; @@ -511,8 +511,8 @@ public function testAddRemixRelationsForExistingParentsHavingDifferentParent(): 'entity' => $first_parent_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($first_parent_entity, $first_parent_entity, 0), - new ProgramRemixRelation($parent_entity_of_first_parent, $first_parent_entity, 1), + new ProjectRemixRelation($first_parent_entity, $first_parent_entity, 0), + new ProjectRemixRelation($parent_entity_of_first_parent, $first_parent_entity, 1), ], ], $second_parent_entity->getId() ?? 'second' => [ @@ -520,25 +520,25 @@ public function testAddRemixRelationsForExistingParentsHavingDifferentParent(): 'entity' => $second_parent_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($second_parent_entity, $second_parent_entity, 0), - new ProgramRemixRelation($parent_entity_of_second_parent, $second_parent_entity, 1), + new ProjectRemixRelation($second_parent_entity, $second_parent_entity, 0), + new ProjectRemixRelation($parent_entity_of_second_parent, $second_parent_entity, 1), ], ], ]; $expected_relations = [ // self-relation - new ProgramRemixRelation($program_entity, $program_entity, 0), + new ProjectRemixRelation($project_entity, $project_entity, 0), // relation to parents - new ProgramRemixRelation($first_parent_entity, $program_entity, 1), - new ProgramRemixRelation($second_parent_entity, $program_entity, 1), + new ProjectRemixRelation($first_parent_entity, $project_entity, 1), + new ProjectRemixRelation($second_parent_entity, $project_entity, 1), // relation to grandparents - new ProgramRemixRelation($parent_entity_of_first_parent, $program_entity, 2), - new ProgramRemixRelation($parent_entity_of_second_parent, $program_entity, 2), + new ProjectRemixRelation($parent_entity_of_first_parent, $project_entity, 2), + new ProjectRemixRelation($parent_entity_of_second_parent, $project_entity, 2), ]; - $this->checkRemixRelations($program_entity, $parent_data, $expected_relations); - $this->assertFalse($program_entity->isRemixRoot()); + $this->checkRemixRelations($project_entity, $parent_data, $expected_relations); + $this->assertFalse($project_entity->isRemixRoot()); } /** @@ -556,7 +556,7 @@ public function testAddRemixRelationsForScratchParent(): void // -------------------------------------------------------------------------------------------------------------- $scratch_parent_id = '29495624'; - $parent_entity_of_first_parent = $this->createMock(Program::class); + $parent_entity_of_first_parent = $this->createMock(Project::class); $parent_entity_of_first_parent->expects($this->atLeastOnce()) ->method('getId')->willReturn('1') ; @@ -565,8 +565,8 @@ public function testAddRemixRelationsForScratchParent(): void ->willReturn($this->createMock(User::class)) ; - $entities = $this->getProgramEntityAndParents('4', '2', '3'); - $program_entity = $entities[0]; + $entities = $this->getProjectEntityAndParents('4', '2', '3'); + $project_entity = $entities[0]; $first_parent_entity = $entities[1]; $second_parent_entity = $entities[2]; @@ -576,8 +576,8 @@ public function testAddRemixRelationsForScratchParent(): void 'entity' => $first_parent_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($first_parent_entity, $first_parent_entity, 0), - new ProgramRemixRelation($parent_entity_of_first_parent, $first_parent_entity, 1), + new ProjectRemixRelation($first_parent_entity, $first_parent_entity, 0), + new ProjectRemixRelation($parent_entity_of_first_parent, $first_parent_entity, 1), ], ], $second_parent_entity->getId() => [ @@ -585,8 +585,8 @@ public function testAddRemixRelationsForScratchParent(): void 'entity' => $second_parent_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($second_parent_entity, $second_parent_entity, 0), - new ScratchProgramRemixRelation($scratch_parent_id, $second_parent_entity), + new ProjectRemixRelation($second_parent_entity, $second_parent_entity, 0), + new ScratchProjectRemixRelation($scratch_parent_id, $second_parent_entity), ], ], $scratch_parent_id => [ @@ -598,18 +598,18 @@ public function testAddRemixRelationsForScratchParent(): void ]; $expected_relations = [ // self-relation - new ProgramRemixRelation($program_entity, $program_entity, 0), + new ProjectRemixRelation($project_entity, $project_entity, 0), // relation to parents - new ProgramRemixRelation($first_parent_entity, $program_entity, 1), - new ProgramRemixRelation($second_parent_entity, $program_entity, 1), - new ScratchProgramRemixRelation($scratch_parent_id, $program_entity), + new ProjectRemixRelation($first_parent_entity, $project_entity, 1), + new ProjectRemixRelation($second_parent_entity, $project_entity, 1), + new ScratchProjectRemixRelation($scratch_parent_id, $project_entity), // relation to grandparents - new ProgramRemixRelation($parent_entity_of_first_parent, $program_entity, 2), + new ProjectRemixRelation($parent_entity_of_first_parent, $project_entity, 2), ]; - $this->checkRemixRelations($program_entity, $parent_data, $expected_relations); - $this->assertFalse($program_entity->isRemixRoot()); + $this->checkRemixRelations($project_entity, $parent_data, $expected_relations); + $this->assertFalse($project_entity->isRemixRoot()); } /** @@ -629,51 +629,51 @@ public function testAddRemixRelationsForMoreComplexGraph1(): void // // -------------------------------------------------------------------------------------------------------------- - $program_entities = $this->getProgramEntities(5); - $first_program_entity = $program_entities[0]; - $second_program_entity = $program_entities[1]; - $third_program_entity = $program_entities[2]; - $fourth_program_entity = $program_entities[3]; - $program_entity = $program_entities[4]; + $project_entities = $this->getProjectEntities(5); + $first_project_entity = $project_entities[0]; + $second_project_entity = $project_entities[1]; + $third_project_entity = $project_entities[2]; + $fourth_project_entity = $project_entities[3]; + $project_entity = $project_entities[4]; - $program_entity->expects($this->atLeastOnce()) + $project_entity->expects($this->atLeastOnce()) ->method('isInitialVersion')->willReturn(true) ; $parent_data = [ - $third_program_entity->getId() => [ + $third_project_entity->getId() => [ 'isScratch' => false, - 'entity' => $third_program_entity, + 'entity' => $third_project_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($third_program_entity, $third_program_entity, 0), - new ProgramRemixRelation($first_program_entity, $third_program_entity, 1), - new ProgramRemixRelation($second_program_entity, $third_program_entity, 1), + new ProjectRemixRelation($third_project_entity, $third_project_entity, 0), + new ProjectRemixRelation($first_project_entity, $third_project_entity, 1), + new ProjectRemixRelation($second_project_entity, $third_project_entity, 1), ], ], - $fourth_program_entity->getId() => [ + $fourth_project_entity->getId() => [ 'isScratch' => false, - 'entity' => $fourth_program_entity, + 'entity' => $fourth_project_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($fourth_program_entity, $fourth_program_entity, 0), - new ProgramRemixRelation($second_program_entity, $fourth_program_entity, 1), + new ProjectRemixRelation($fourth_project_entity, $fourth_project_entity, 0), + new ProjectRemixRelation($second_project_entity, $fourth_project_entity, 1), ], ], ]; $expected_relations = [ // self-relation - new ProgramRemixRelation($program_entity, $program_entity, 0), + new ProjectRemixRelation($project_entity, $project_entity, 0), // relation to parents - new ProgramRemixRelation($third_program_entity, $program_entity, 1), - new ProgramRemixRelation($fourth_program_entity, $program_entity, 1), + new ProjectRemixRelation($third_project_entity, $project_entity, 1), + new ProjectRemixRelation($fourth_project_entity, $project_entity, 1), // relation to grandparents - new ProgramRemixRelation($first_program_entity, $program_entity, 2), - new ProgramRemixRelation($second_program_entity, $program_entity, 2), + new ProjectRemixRelation($first_project_entity, $project_entity, 2), + new ProjectRemixRelation($second_project_entity, $project_entity, 2), ]; - $this->checkRemixRelations($program_entity, $parent_data, $expected_relations); - $this->assertFalse($program_entity->isRemixRoot()); + $this->checkRemixRelations($project_entity, $parent_data, $expected_relations); + $this->assertFalse($project_entity->isRemixRoot()); } /** @@ -697,58 +697,58 @@ public function testAddRemixRelationsForMoreComplexGraph2(): void // (7) <--------- to be added // // -------------------------------------------------------------------------------------------------------------- - $program_entities = $this->getProgramEntities(7); - $first_program_entity = $program_entities[0]; - $second_program_entity = $program_entities[1]; - $third_program_entity = $program_entities[2]; - $fourth_program_entity = $program_entities[3]; - $fifth_program_entity = $program_entities[4]; - $sixth_program_entity = $program_entities[5]; + $project_entities = $this->getProjectEntities(7); + $first_project_entity = $project_entities[0]; + $second_project_entity = $project_entities[1]; + $third_project_entity = $project_entities[2]; + $fourth_project_entity = $project_entities[3]; + $fifth_project_entity = $project_entities[4]; + $sixth_project_entity = $project_entities[5]; - $program_entity = $program_entities[6]; + $project_entity = $project_entities[6]; $parent_data = [ - $fifth_program_entity->getId() => [ + $fifth_project_entity->getId() => [ 'isScratch' => false, - 'entity' => $fifth_program_entity, + 'entity' => $fifth_project_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($fifth_program_entity, $fifth_program_entity, 0), - new ProgramRemixRelation($third_program_entity, $fifth_program_entity, 1), - new ProgramRemixRelation($fourth_program_entity, $fifth_program_entity, 1), - new ProgramRemixRelation($first_program_entity, $fifth_program_entity, 2), - new ProgramRemixRelation($second_program_entity, $fifth_program_entity, 2), + new ProjectRemixRelation($fifth_project_entity, $fifth_project_entity, 0), + new ProjectRemixRelation($third_project_entity, $fifth_project_entity, 1), + new ProjectRemixRelation($fourth_project_entity, $fifth_project_entity, 1), + new ProjectRemixRelation($first_project_entity, $fifth_project_entity, 2), + new ProjectRemixRelation($second_project_entity, $fifth_project_entity, 2), ], ], - $sixth_program_entity->getId() => [ + $sixth_project_entity->getId() => [ 'isScratch' => false, - 'entity' => $sixth_program_entity, + 'entity' => $sixth_project_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($sixth_program_entity, $sixth_program_entity, 0), - new ProgramRemixRelation($fourth_program_entity, $sixth_program_entity, 1), - new ProgramRemixRelation($second_program_entity, $sixth_program_entity, 2), + new ProjectRemixRelation($sixth_project_entity, $sixth_project_entity, 0), + new ProjectRemixRelation($fourth_project_entity, $sixth_project_entity, 1), + new ProjectRemixRelation($second_project_entity, $sixth_project_entity, 2), ], ], ]; $expected_relations = [ // self-relation - new ProgramRemixRelation($program_entity, $program_entity, 0), + new ProjectRemixRelation($project_entity, $project_entity, 0), // relation to parents - new ProgramRemixRelation($fifth_program_entity, $program_entity, 1), - new ProgramRemixRelation($sixth_program_entity, $program_entity, 1), + new ProjectRemixRelation($fifth_project_entity, $project_entity, 1), + new ProjectRemixRelation($sixth_project_entity, $project_entity, 1), // relation to grandparents - new ProgramRemixRelation($third_program_entity, $program_entity, 2), - new ProgramRemixRelation($fourth_program_entity, $program_entity, 2), + new ProjectRemixRelation($third_project_entity, $project_entity, 2), + new ProjectRemixRelation($fourth_project_entity, $project_entity, 2), // relation to parents of grandparents - new ProgramRemixRelation($first_program_entity, $program_entity, 3), - new ProgramRemixRelation($second_program_entity, $program_entity, 3), + new ProjectRemixRelation($first_project_entity, $project_entity, 3), + new ProjectRemixRelation($second_project_entity, $project_entity, 3), ]; - $this->checkRemixRelations($program_entity, $parent_data, $expected_relations); - $this->assertFalse($program_entity->isRemixRoot()); + $this->checkRemixRelations($project_entity, $parent_data, $expected_relations); + $this->assertFalse($project_entity->isRemixRoot()); } /** @@ -769,59 +769,59 @@ public function testAddRemixRelationsForMoreComplexGraph3(): void // (7) <--------- to be added // // -------------------------------------------------------------------------------------------------------------- - $program_entities = $this->getProgramEntities(7); - $first_program_entity = $program_entities[0]; - $second_program_entity = $program_entities[1]; - $third_program_entity = $program_entities[2]; - $fourth_program_entity = $program_entities[3]; - $fifth_program_entity = $program_entities[4]; - $sixth_program_entity = $program_entities[5]; + $project_entities = $this->getProjectEntities(7); + $first_project_entity = $project_entities[0]; + $second_project_entity = $project_entities[1]; + $third_project_entity = $project_entities[2]; + $fourth_project_entity = $project_entities[3]; + $fifth_project_entity = $project_entities[4]; + $sixth_project_entity = $project_entities[5]; - $program_entity = $program_entities[6]; + $project_entity = $project_entities[6]; $parent_data = [ - $fifth_program_entity->getId() => [ + $fifth_project_entity->getId() => [ 'isScratch' => false, - 'entity' => $fifth_program_entity, + 'entity' => $fifth_project_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($fifth_program_entity, $fifth_program_entity, 0), - new ProgramRemixRelation($third_program_entity, $fifth_program_entity, 1), - new ProgramRemixRelation($second_program_entity, $fifth_program_entity, 1), - new ProgramRemixRelation($first_program_entity, $fifth_program_entity, 2), - new ProgramRemixRelation($second_program_entity, $fifth_program_entity, 2), + new ProjectRemixRelation($fifth_project_entity, $fifth_project_entity, 0), + new ProjectRemixRelation($third_project_entity, $fifth_project_entity, 1), + new ProjectRemixRelation($second_project_entity, $fifth_project_entity, 1), + new ProjectRemixRelation($first_project_entity, $fifth_project_entity, 2), + new ProjectRemixRelation($second_project_entity, $fifth_project_entity, 2), ], ], - $sixth_program_entity->getId() => [ + $sixth_project_entity->getId() => [ 'isScratch' => false, - 'entity' => $sixth_program_entity, + 'entity' => $sixth_project_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($sixth_program_entity, $sixth_program_entity, 0), - new ProgramRemixRelation($fourth_program_entity, $sixth_program_entity, 1), - new ProgramRemixRelation($second_program_entity, $sixth_program_entity, 2), + new ProjectRemixRelation($sixth_project_entity, $sixth_project_entity, 0), + new ProjectRemixRelation($fourth_project_entity, $sixth_project_entity, 1), + new ProjectRemixRelation($second_project_entity, $sixth_project_entity, 2), ], ], ]; $expected_relations = [ // self-relation - new ProgramRemixRelation($program_entity, $program_entity, 0), + new ProjectRemixRelation($project_entity, $project_entity, 0), // relation to parents - new ProgramRemixRelation($fifth_program_entity, $program_entity, 1), - new ProgramRemixRelation($sixth_program_entity, $program_entity, 1), + new ProjectRemixRelation($fifth_project_entity, $project_entity, 1), + new ProjectRemixRelation($sixth_project_entity, $project_entity, 1), // relation to grandparents - new ProgramRemixRelation($third_program_entity, $program_entity, 2), - new ProgramRemixRelation($second_program_entity, $program_entity, 2), - new ProgramRemixRelation($fourth_program_entity, $program_entity, 2), + new ProjectRemixRelation($third_project_entity, $project_entity, 2), + new ProjectRemixRelation($second_project_entity, $project_entity, 2), + new ProjectRemixRelation($fourth_project_entity, $project_entity, 2), // relation to parents of grandparents - new ProgramRemixRelation($first_program_entity, $program_entity, 3), - new ProgramRemixRelation($second_program_entity, $program_entity, 3), + new ProjectRemixRelation($first_project_entity, $project_entity, 3), + new ProjectRemixRelation($second_project_entity, $project_entity, 3), ]; - $this->checkRemixRelations($program_entity, $parent_data, $expected_relations); - $this->assertFalse($program_entity->isRemixRoot()); + $this->checkRemixRelations($project_entity, $parent_data, $expected_relations); + $this->assertFalse($project_entity->isRemixRoot()); } /** @@ -843,73 +843,73 @@ public function testAddRemixRelationsForMoreComplexGraph4(): void // // -------------------------------------------------------------------------------------------------------------- - $program_entities = $this->getProgramEntities(7); - $first_program_entity = $program_entities[0]; - $second_program_entity = $program_entities[1]; - $third_program_entity = $program_entities[2]; - $fourth_program_entity = $program_entities[3]; - $fifth_program_entity = $program_entities[4]; - $sixth_program_entity = $program_entities[5]; + $project_entities = $this->getProjectEntities(7); + $first_project_entity = $project_entities[0]; + $second_project_entity = $project_entities[1]; + $third_project_entity = $project_entities[2]; + $fourth_project_entity = $project_entities[3]; + $fifth_project_entity = $project_entities[4]; + $sixth_project_entity = $project_entities[5]; - $program_entity = $program_entities[6]; + $project_entity = $project_entities[6]; $parent_data = [ - $third_program_entity->getId() => [ + $third_project_entity->getId() => [ 'isScratch' => false, - 'entity' => $third_program_entity, + 'entity' => $third_project_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($third_program_entity, $third_program_entity, 0), - new ProgramRemixRelation($first_program_entity, $third_program_entity, 1), - new ProgramRemixRelation($second_program_entity, $third_program_entity, 1), + new ProjectRemixRelation($third_project_entity, $third_project_entity, 0), + new ProjectRemixRelation($first_project_entity, $third_project_entity, 1), + new ProjectRemixRelation($second_project_entity, $third_project_entity, 1), ], ], - $fifth_program_entity->getId() => [ + $fifth_project_entity->getId() => [ 'isScratch' => false, - 'entity' => $fifth_program_entity, + 'entity' => $fifth_project_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($fifth_program_entity, $fifth_program_entity, 0), - new ProgramRemixRelation($third_program_entity, $fifth_program_entity, 1), - new ProgramRemixRelation($second_program_entity, $fifth_program_entity, 1), - new ProgramRemixRelation($fourth_program_entity, $fifth_program_entity, 1), - new ProgramRemixRelation($first_program_entity, $fifth_program_entity, 2), - new ProgramRemixRelation($second_program_entity, $fifth_program_entity, 2), + new ProjectRemixRelation($fifth_project_entity, $fifth_project_entity, 0), + new ProjectRemixRelation($third_project_entity, $fifth_project_entity, 1), + new ProjectRemixRelation($second_project_entity, $fifth_project_entity, 1), + new ProjectRemixRelation($fourth_project_entity, $fifth_project_entity, 1), + new ProjectRemixRelation($first_project_entity, $fifth_project_entity, 2), + new ProjectRemixRelation($second_project_entity, $fifth_project_entity, 2), ], ], - $sixth_program_entity->getId() => [ + $sixth_project_entity->getId() => [ 'isScratch' => false, - 'entity' => $sixth_program_entity, + 'entity' => $sixth_project_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($sixth_program_entity, $sixth_program_entity, 0), - new ProgramRemixRelation($fourth_program_entity, $sixth_program_entity, 1), - new ProgramRemixRelation($second_program_entity, $sixth_program_entity, 1), - new ProgramRemixRelation($second_program_entity, $sixth_program_entity, 2), + new ProjectRemixRelation($sixth_project_entity, $sixth_project_entity, 0), + new ProjectRemixRelation($fourth_project_entity, $sixth_project_entity, 1), + new ProjectRemixRelation($second_project_entity, $sixth_project_entity, 1), + new ProjectRemixRelation($second_project_entity, $sixth_project_entity, 2), ], ], ]; $expected_relations = [ // self-relation - new ProgramRemixRelation($program_entity, $program_entity, 0), + new ProjectRemixRelation($project_entity, $project_entity, 0), // relation to parents - new ProgramRemixRelation($third_program_entity, $program_entity, 1), - new ProgramRemixRelation($fifth_program_entity, $program_entity, 1), - new ProgramRemixRelation($sixth_program_entity, $program_entity, 1), + new ProjectRemixRelation($third_project_entity, $project_entity, 1), + new ProjectRemixRelation($fifth_project_entity, $project_entity, 1), + new ProjectRemixRelation($sixth_project_entity, $project_entity, 1), // relation to grandparents - new ProgramRemixRelation($first_program_entity, $program_entity, 2), - new ProgramRemixRelation($second_program_entity, $program_entity, 2), - new ProgramRemixRelation($third_program_entity, $program_entity, 2), - new ProgramRemixRelation($fourth_program_entity, $program_entity, 2), + new ProjectRemixRelation($first_project_entity, $project_entity, 2), + new ProjectRemixRelation($second_project_entity, $project_entity, 2), + new ProjectRemixRelation($third_project_entity, $project_entity, 2), + new ProjectRemixRelation($fourth_project_entity, $project_entity, 2), // relation to parents of grandparents - new ProgramRemixRelation($first_program_entity, $program_entity, 3), - new ProgramRemixRelation($second_program_entity, $program_entity, 3), + new ProjectRemixRelation($first_project_entity, $project_entity, 3), + new ProjectRemixRelation($second_project_entity, $project_entity, 3), ]; - $this->checkRemixRelations($program_entity, $parent_data, $expected_relations); - $this->assertFalse($program_entity->isRemixRoot()); + $this->checkRemixRelations($project_entity, $parent_data, $expected_relations); + $this->assertFalse($project_entity->isRemixRoot()); } /** @@ -933,46 +933,46 @@ public function testAddRemixRelationsForMoreComplexGraph5(): void $scratch_parent_id = '29495624'; - $program_entities = $this->getProgramEntities(6); - $first_program_entity = $program_entities[0]; - $second_program_entity = $program_entities[1]; - $third_program_entity = $program_entities[2]; - $fourth_program_entity = $program_entities[3]; - $fifth_program_entity = $program_entities[4]; + $project_entities = $this->getProjectEntities(6); + $first_project_entity = $project_entities[0]; + $second_project_entity = $project_entities[1]; + $third_project_entity = $project_entities[2]; + $fourth_project_entity = $project_entities[3]; + $fifth_project_entity = $project_entities[4]; - $program_entity = $program_entities[5]; + $project_entity = $project_entities[5]; $parent_data = [ - $second_program_entity->getId() => [ + $second_project_entity->getId() => [ 'isScratch' => false, - 'entity' => $second_program_entity, + 'entity' => $second_project_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($second_program_entity, $second_program_entity, 0), - new ProgramRemixRelation($first_program_entity, $second_program_entity, 1), - new ScratchProgramRemixRelation($scratch_parent_id, $second_program_entity), + new ProjectRemixRelation($second_project_entity, $second_project_entity, 0), + new ProjectRemixRelation($first_project_entity, $second_project_entity, 1), + new ScratchProjectRemixRelation($scratch_parent_id, $second_project_entity), ], ], - $fourth_program_entity->getId() => [ + $fourth_project_entity->getId() => [ 'isScratch' => false, - 'entity' => $fourth_program_entity, + 'entity' => $fourth_project_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($fourth_program_entity, $fourth_program_entity, 0), - new ProgramRemixRelation($third_program_entity, $fourth_program_entity, 1), - new ProgramRemixRelation($second_program_entity, $fourth_program_entity, 1), - new ScratchProgramRemixRelation($scratch_parent_id, $fourth_program_entity), - new ProgramRemixRelation($first_program_entity, $fourth_program_entity, 2), + new ProjectRemixRelation($fourth_project_entity, $fourth_project_entity, 0), + new ProjectRemixRelation($third_project_entity, $fourth_project_entity, 1), + new ProjectRemixRelation($second_project_entity, $fourth_project_entity, 1), + new ScratchProjectRemixRelation($scratch_parent_id, $fourth_project_entity), + new ProjectRemixRelation($first_project_entity, $fourth_project_entity, 2), ], ], - $fifth_program_entity->getId() => [ + $fifth_project_entity->getId() => [ 'isScratch' => false, - 'entity' => $fifth_program_entity, + 'entity' => $fifth_project_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($fifth_program_entity, $fifth_program_entity, 0), - new ProgramRemixRelation($third_program_entity, $fifth_program_entity, 1), - new ScratchProgramRemixRelation($scratch_parent_id, $fifth_program_entity), + new ProjectRemixRelation($fifth_project_entity, $fifth_project_entity, 0), + new ProjectRemixRelation($third_project_entity, $fifth_project_entity, 1), + new ScratchProjectRemixRelation($scratch_parent_id, $fifth_project_entity), ], ], $scratch_parent_id => [ @@ -984,24 +984,24 @@ public function testAddRemixRelationsForMoreComplexGraph5(): void ]; $expected_relations = [ // self-relation - new ProgramRemixRelation($program_entity, $program_entity, 0), + new ProjectRemixRelation($project_entity, $project_entity, 0), // relation to parents - new ProgramRemixRelation($second_program_entity, $program_entity, 1), - new ProgramRemixRelation($fourth_program_entity, $program_entity, 1), - new ProgramRemixRelation($fifth_program_entity, $program_entity, 1), - new ScratchProgramRemixRelation($scratch_parent_id, $program_entity), + new ProjectRemixRelation($second_project_entity, $project_entity, 1), + new ProjectRemixRelation($fourth_project_entity, $project_entity, 1), + new ProjectRemixRelation($fifth_project_entity, $project_entity, 1), + new ScratchProjectRemixRelation($scratch_parent_id, $project_entity), // relation to grandparents - new ProgramRemixRelation($first_program_entity, $program_entity, 2), - new ProgramRemixRelation($second_program_entity, $program_entity, 2), - new ProgramRemixRelation($third_program_entity, $program_entity, 2), + new ProjectRemixRelation($first_project_entity, $project_entity, 2), + new ProjectRemixRelation($second_project_entity, $project_entity, 2), + new ProjectRemixRelation($third_project_entity, $project_entity, 2), // relation to parents of grandparents - new ProgramRemixRelation($first_program_entity, $program_entity, 3), + new ProjectRemixRelation($first_project_entity, $project_entity, 3), ]; - $this->checkRemixRelations($program_entity, $parent_data, $expected_relations); - $this->assertFalse($program_entity->isRemixRoot()); + $this->checkRemixRelations($project_entity, $parent_data, $expected_relations); + $this->assertFalse($project_entity->isRemixRoot()); } /** @@ -1025,44 +1025,44 @@ public function testAddRemixRelationsForMoreComplexGraph6(): void $first_scratch_ancestor_id = '124742637'; $second_scratch_parent_id = '29495624'; - $program_entities = $this->getProgramEntities(5); - $first_program_entity = $program_entities[0]; - $second_program_entity = $program_entities[1]; - $third_program_entity = $program_entities[2]; - $fourth_program_entity = $program_entities[3]; + $project_entities = $this->getProjectEntities(5); + $first_project_entity = $project_entities[0]; + $second_project_entity = $project_entities[1]; + $third_project_entity = $project_entities[2]; + $fourth_project_entity = $project_entities[3]; - $program_entity = $program_entities[4]; + $project_entity = $project_entities[4]; $parent_data = [ - $first_program_entity->getId() => [ + $first_project_entity->getId() => [ 'isScratch' => false, - 'entity' => $first_program_entity, + 'entity' => $first_project_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($first_program_entity, $first_program_entity, 0), - new ScratchProgramRemixRelation($first_scratch_ancestor_id, $first_program_entity), - new ScratchProgramRemixRelation($second_scratch_parent_id, $first_program_entity), + new ProjectRemixRelation($first_project_entity, $first_project_entity, 0), + new ScratchProjectRemixRelation($first_scratch_ancestor_id, $first_project_entity), + new ScratchProjectRemixRelation($second_scratch_parent_id, $first_project_entity), ], ], - $third_program_entity->getId() => [ + $third_project_entity->getId() => [ 'isScratch' => false, - 'entity' => $third_program_entity, + 'entity' => $third_project_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($third_program_entity, $third_program_entity, 0), - new ProgramRemixRelation($second_program_entity, $third_program_entity, 1), - new ProgramRemixRelation($first_program_entity, $third_program_entity, 1), - new ScratchProgramRemixRelation($second_scratch_parent_id, $third_program_entity), + new ProjectRemixRelation($third_project_entity, $third_project_entity, 0), + new ProjectRemixRelation($second_project_entity, $third_project_entity, 1), + new ProjectRemixRelation($first_project_entity, $third_project_entity, 1), + new ScratchProjectRemixRelation($second_scratch_parent_id, $third_project_entity), ], ], - $fourth_program_entity->getId() => [ + $fourth_project_entity->getId() => [ 'isScratch' => false, - 'entity' => $fourth_program_entity, + 'entity' => $fourth_project_entity, 'exists' => true, 'existingRelations' => [ - new ProgramRemixRelation($fourth_program_entity, $fourth_program_entity, 0), - new ProgramRemixRelation($second_program_entity, $fourth_program_entity, 1), - new ScratchProgramRemixRelation($second_scratch_parent_id, $fourth_program_entity), + new ProjectRemixRelation($fourth_project_entity, $fourth_project_entity, 0), + new ProjectRemixRelation($second_project_entity, $fourth_project_entity, 1), + new ScratchProjectRemixRelation($second_scratch_parent_id, $fourth_project_entity), ], ], $second_scratch_parent_id => [ @@ -1075,20 +1075,20 @@ public function testAddRemixRelationsForMoreComplexGraph6(): void $expected_relations = [ // self-relation - new ProgramRemixRelation($program_entity, $program_entity, 0), + new ProjectRemixRelation($project_entity, $project_entity, 0), // relation to parents - new ProgramRemixRelation($first_program_entity, $program_entity, 1), - new ProgramRemixRelation($third_program_entity, $program_entity, 1), - new ProgramRemixRelation($fourth_program_entity, $program_entity, 1), - new ScratchProgramRemixRelation($second_scratch_parent_id, $program_entity), + new ProjectRemixRelation($first_project_entity, $project_entity, 1), + new ProjectRemixRelation($third_project_entity, $project_entity, 1), + new ProjectRemixRelation($fourth_project_entity, $project_entity, 1), + new ScratchProjectRemixRelation($second_scratch_parent_id, $project_entity), // relation to grandparents - new ProgramRemixRelation($first_program_entity, $program_entity, 2), - new ProgramRemixRelation($second_program_entity, $program_entity, 2), + new ProjectRemixRelation($first_project_entity, $project_entity, 2), + new ProjectRemixRelation($second_project_entity, $project_entity, 2), ]; - $this->checkRemixRelations($program_entity, $parent_data, $expected_relations); - $this->assertFalse($program_entity->isRemixRoot()); + $this->checkRemixRelations($project_entity, $parent_data, $expected_relations); + $this->assertFalse($project_entity->isRemixRoot()); } /** @@ -1114,50 +1114,50 @@ public function testAddRemixRelationsForMoreComplexGraph7(): void $second_scratch_parent_id = '29495624'; $third_scratch_parent_id = '124742637'; - $program_entities = $this->getProgramEntities(5); - $first_program_entity = $program_entities[0]; - $second_program_entity = $program_entities[1]; - $third_program_entity = $program_entities[2]; - $fourth_program_entity = $program_entities[3]; - $program_entity = $program_entities[4]; - - $existingRelationsFirstProgramEntity = [ - new ProgramRemixRelation($first_program_entity, $first_program_entity, 0), - new ScratchProgramRemixRelation($first_scratch_ancestor_id, $first_program_entity), - new ScratchProgramRemixRelation($second_scratch_parent_id, $first_program_entity), + $project_entities = $this->getProjectEntities(5); + $first_project_entity = $project_entities[0]; + $second_project_entity = $project_entities[1]; + $third_project_entity = $project_entities[2]; + $fourth_project_entity = $project_entities[3]; + $project_entity = $project_entities[4]; + + $existingRelationsFirstProjectEntity = [ + new ProjectRemixRelation($first_project_entity, $first_project_entity, 0), + new ScratchProjectRemixRelation($first_scratch_ancestor_id, $first_project_entity), + new ScratchProjectRemixRelation($second_scratch_parent_id, $first_project_entity), ]; - $existingRelationsThirdProgramEntity = [ - new ProgramRemixRelation($third_program_entity, $third_program_entity, 0), - new ProgramRemixRelation($second_program_entity, $third_program_entity, 1), - new ProgramRemixRelation($first_program_entity, $third_program_entity, 1), - new ScratchProgramRemixRelation($second_scratch_parent_id, $third_program_entity), + $existingRelationsThirdProjectEntity = [ + new ProjectRemixRelation($third_project_entity, $third_project_entity, 0), + new ProjectRemixRelation($second_project_entity, $third_project_entity, 1), + new ProjectRemixRelation($first_project_entity, $third_project_entity, 1), + new ScratchProjectRemixRelation($second_scratch_parent_id, $third_project_entity), ]; - $existingRelationsFourthProgramEntity = [ - new ProgramRemixRelation($fourth_program_entity, $fourth_program_entity, 0), - new ProgramRemixRelation($second_program_entity, $fourth_program_entity, 1), - new ScratchProgramRemixRelation($second_scratch_parent_id, $fourth_program_entity), + $existingRelationsFourthProjectEntity = [ + new ProjectRemixRelation($fourth_project_entity, $fourth_project_entity, 0), + new ProjectRemixRelation($second_project_entity, $fourth_project_entity, 1), + new ScratchProjectRemixRelation($second_scratch_parent_id, $fourth_project_entity), ]; $parent_data = [ - $first_program_entity->getId() ?? 'first' => [ + $first_project_entity->getId() ?? 'first' => [ 'isScratch' => false, - 'entity' => $first_program_entity, + 'entity' => $first_project_entity, 'exists' => true, - 'existingRelations' => $existingRelationsFirstProgramEntity, + 'existingRelations' => $existingRelationsFirstProjectEntity, ], - $third_program_entity->getId() ?? 'third' => [ + $third_project_entity->getId() ?? 'third' => [ 'isScratch' => false, - 'entity' => $third_program_entity, + 'entity' => $third_project_entity, 'exists' => true, - 'existingRelations' => $existingRelationsThirdProgramEntity, + 'existingRelations' => $existingRelationsThirdProjectEntity, ], - $fourth_program_entity->getId() ?? 'fourth' => [ + $fourth_project_entity->getId() ?? 'fourth' => [ 'isScratch' => false, - 'entity' => $fourth_program_entity, + 'entity' => $fourth_project_entity, 'exists' => true, - 'existingRelations' => $existingRelationsFourthProgramEntity, + 'existingRelations' => $existingRelationsFourthProjectEntity, ], $second_scratch_parent_id => [ 'isScratch' => true, @@ -1175,73 +1175,73 @@ public function testAddRemixRelationsForMoreComplexGraph7(): void $expected_relations = [ // self-relation - new ProgramRemixRelation($program_entity, $program_entity, 0), + new ProjectRemixRelation($project_entity, $project_entity, 0), // relation to parents - new ProgramRemixRelation($first_program_entity, $program_entity, 1), - new ProgramRemixRelation($third_program_entity, $program_entity, 1), - new ProgramRemixRelation($fourth_program_entity, $program_entity, 1), - new ScratchProgramRemixRelation($second_scratch_parent_id, $program_entity), - new ScratchProgramRemixRelation($third_scratch_parent_id, $program_entity), + new ProjectRemixRelation($first_project_entity, $project_entity, 1), + new ProjectRemixRelation($third_project_entity, $project_entity, 1), + new ProjectRemixRelation($fourth_project_entity, $project_entity, 1), + new ScratchProjectRemixRelation($second_scratch_parent_id, $project_entity), + new ScratchProjectRemixRelation($third_scratch_parent_id, $project_entity), // relation to grandparents - new ProgramRemixRelation($first_program_entity, $program_entity, 2), - new ProgramRemixRelation($second_program_entity, $program_entity, 2), + new ProjectRemixRelation($first_project_entity, $project_entity, 2), + new ProjectRemixRelation($second_project_entity, $project_entity, 2), ]; - $this->checkRemixRelations($program_entity, $parent_data, $expected_relations); - $this->assertFalse($program_entity->isRemixRoot()); + $this->checkRemixRelations($project_entity, $parent_data, $expected_relations); + $this->assertFalse($project_entity->isRemixRoot()); } /** - * @param Program|MockObject $program_entity + * @param Project|MockObject $project_entity * * @throws \Exception */ - private function checkRemixRelations($program_entity, array $parent_data, array $expected_relations): void + private function checkRemixRelations($project_entity, array $parent_data, array $expected_relations): void { - /** @var MockObject|Program $program_entity */ + /** @var MockObject|Project $project_entity */ $expected_relations_map = []; $expected_catrobat_relations = []; foreach ($expected_relations as $expected_relation) { - if ($expected_relation instanceof ProgramRemixRelation) { + if ($expected_relation instanceof ProjectRemixRelation) { $expected_catrobat_relations[] = $expected_relation; } $expected_relations_map[$expected_relation->getUniqueKey()] = $expected_relation; } - $program_repository_find_map = []; - $program_remix_repository_find_map = []; + $project_repository_find_map = []; + $project_remix_repository_find_map = []; foreach ($parent_data as $parent_id => $data) { - $catrobat_relations = array_filter($data['existingRelations'], fn ($relation) => $relation instanceof ProgramRemixRelation); - $program_remix_repository_find_map[] = [['descendant_id' => (string) $parent_id], null, null, null, $catrobat_relations]; - $program_repository_find_map[] = [(string) $parent_id, null, null, $data['exists'] ? $data['entity'] : null]; + $catrobat_relations = array_filter($data['existingRelations'], fn ($relation) => $relation instanceof ProjectRemixRelation); + $project_remix_repository_find_map[] = [['descendant_id' => (string) $parent_id], null, null, null, $catrobat_relations]; + $project_repository_find_map[] = [(string) $parent_id, null, null, $data['exists'] ? $data['entity'] : null]; } - $this->program_repository + $this->project_repository ->expects($this->any()) ->method('find') - ->willReturn($this->returnValueMap($program_repository_find_map)) + ->willReturn($this->returnValueMap($project_repository_find_map)) ; - $this->program_remix_repository + $this->project_remix_repository ->expects($this->any()) ->method('findBy') - ->willReturn($this->returnValueMap($program_remix_repository_find_map)) + ->willReturn($this->returnValueMap($project_remix_repository_find_map)) ; $this->entity_manager ->expects($this->atLeastOnce()) ->method('persist') - ->will($this->returnCallback(function ($arg) use ($program_entity, &$expected_relations_map) { - if ($arg instanceof ProgramRemixRelation || $arg instanceof ScratchProgramRemixRelation) { + ->will($this->returnCallback(function ($arg) use ($project_entity, &$expected_relations_map) { + if ($arg instanceof ProjectRemixRelation || $arg instanceof ScratchProjectRemixRelation) { $relation = $arg; Assert::assertArrayHasKey($relation->getUniqueKey(), $expected_relations_map); unset($expected_relations_map[$relation->getUniqueKey()]); } - if ($arg instanceof Program) { - Assert::assertEquals($arg, $program_entity); + if ($arg instanceof Project) { + Assert::assertEquals($arg, $project_entity); } })) ; @@ -1257,53 +1257,53 @@ private function checkRemixRelations($program_entity, array $parent_data, array Assert::assertCount(count($expected_relations), $expected_relations_map); $expected_to_be_root = (1 === count($expected_catrobat_relations)); - $program_entity->expects($this->atLeastOnce()) + $project_entity->expects($this->atLeastOnce()) ->method('isRemixRoot')->willReturn($expected_to_be_root) ; - $this->remix_manager->addRemixes($program_entity, $remixes_data); + $this->remix_manager->addRemixes($project_entity, $remixes_data); Assert::assertCount(0, $expected_relations_map); } - private function getProgramEntities(int $amount): array + private function getProjectEntities(int $amount): array { $array = []; for ($i = 1; $i <= $amount; ++$i) { - $program_entity = $this->createMock(Program::class); - $program_entity->expects($this->atLeastOnce()) + $project_entity = $this->createMock(Project::class); + $project_entity->expects($this->atLeastOnce()) ->method('getId') ->willReturn(strval($i)) ; - $program_entity->expects($this->any()) + $project_entity->expects($this->any()) ->method('getUser') ->willReturn($this->createMock(User::class)) ; if ($i === $amount) { - $program_entity->expects($this->atLeastOnce()) + $project_entity->expects($this->atLeastOnce()) ->method('isInitialVersion') ->willReturn(true) ; } - $array[] = $program_entity; + $array[] = $project_entity; } return $array; } - private function getProgramEntityAndParents(string $entityReturn = '123', string $firstParentReturn = '3570', string $secParentReturn = '16267'): array + private function getProjectEntityAndParents(string $entityReturn = '123', string $firstParentReturn = '3570', string $secParentReturn = '16267'): array { - $program_entity = $this->createMock(Program::class); - $program_entity->expects($this->atLeastOnce()) + $project_entity = $this->createMock(Project::class); + $project_entity->expects($this->atLeastOnce()) ->method('getId')->willReturn($entityReturn) ; - $program_entity->expects($this->atLeastOnce()) + $project_entity->expects($this->atLeastOnce()) ->method('isInitialVersion')->willReturn(true) ; - $program_entity->expects($this->any()) + $project_entity->expects($this->any()) ->method('getUser') ->willReturn($this->createMock(User::class)) ; - $first_parent_entity = $this->createMock(Program::class); + $first_parent_entity = $this->createMock(Project::class); $first_parent_entity->expects($this->atLeastOnce()) ->method('getId')->willReturn($firstParentReturn) ; @@ -1312,7 +1312,7 @@ private function getProgramEntityAndParents(string $entityReturn = '123', string ->willReturn($this->createMock(User::class)) ; - $second_parent_entity = $this->createMock(Program::class); + $second_parent_entity = $this->createMock(Project::class); $second_parent_entity->expects($this->atLeastOnce()) ->method('getId') ->willReturn($secParentReturn) @@ -1323,7 +1323,7 @@ private function getProgramEntityAndParents(string $entityReturn = '123', string ; $array = []; - array_push($array, $program_entity, $first_parent_entity, $second_parent_entity); + array_push($array, $project_entity, $first_parent_entity, $second_parent_entity); return $array; } diff --git a/tests/PhpUnit/Project/Remix/RemixUpdaterEventSubscriberTest.php b/tests/PhpUnit/Project/Remix/RemixUpdaterEventSubscriberTest.php index 9978564e8b..4ba30688f7 100644 --- a/tests/PhpUnit/Project/Remix/RemixUpdaterEventSubscriberTest.php +++ b/tests/PhpUnit/Project/Remix/RemixUpdaterEventSubscriberTest.php @@ -2,7 +2,7 @@ namespace Tests\PhpUnit\Project\Remix; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\Entity\User\User; use App\Project\CatrobatFile\ExtractedCatrobatFile; use App\Project\Remix\RemixData; @@ -31,7 +31,7 @@ class RemixUpdaterEventSubscriberTest extends TestCase private AsyncHttpClient|MockObject $async_http_client; - private MockObject|Program $program_entity; + private MockObject|Project $project_entity; protected function setUp(): void { @@ -52,7 +52,7 @@ protected function setUp(): void ->will($this->returnValueMap($route_map)) ; - $this->program_entity = $this->createMock(Program::class); + $this->project_entity = $this->createMock(Project::class); $this->remix_updater = new RemixUpdaterEventSubscriber($this->remix_manager, $this->async_http_client, $router, '.'); @@ -67,7 +67,7 @@ protected function setUp(): void ->willReturn('catroweb') ; - $this->program_entity + $this->project_entity ->expects($this->any()) ->method('getUser') ->willReturn($user) @@ -94,13 +94,13 @@ public function testSavesTheNewUrlToXml(): void $this->assertInstanceOf(\SimpleXMLElement::class, $xml); $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); - $this->program_entity + $this->project_entity ->expects($this->atLeastOnce()) ->method('getId') ->willReturn('3571') ; - $this->program_entity + $this->project_entity ->expects($this->atLeastOnce()) ->method('isInitialVersion') ->willReturn(true) @@ -125,14 +125,14 @@ public function testSavesTheNewUrlToXml(): void ; $this->remix_manager->expects($this->atLeastOnce()) - ->method('addRemixes')->with($this->isInstanceOf(Program::class)) + ->method('addRemixes')->with($this->isInstanceOf(Project::class)) ; $this->remix_manager->expects($this->atLeastOnce())->method('getProjectRepository'); Assert::assertNotEquals($xml->header->url->__toString(), $expected_url); - $this->remix_updater->update($file, $this->program_entity); + $this->remix_updater->update($file, $this->project_entity); $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); Assert::assertInstanceOf(\SimpleXMLElement::class, $xml); @@ -144,9 +144,9 @@ public function testSavesTheNewUrlToXml(): void * * @psalm-suppress UndefinedPropertyAssignment */ - public function testCallFetchesScratchProgramDetailsAndAddScratchProgramMethodIfCatrobatLanguageVersionIs0993(): void + public function testCallFetchesScratchProjectDetailsAndAddScratchProjectMethodIfCatrobatLanguageVersionIs0993(): void { - $new_program_id = '3571'; + $new_project_id = '3571'; $first_expected_scratch_id = '118499611'; $second_expected_scratch_id = '70058680'; $expected_scratch_ids = [$first_expected_scratch_id, $second_expected_scratch_id]; @@ -164,8 +164,8 @@ public function testCallFetchesScratchProgramDetailsAndAddScratchProgramMethodIf } $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); - $this->program_entity->expects($this->atLeastOnce())->method('getId')->willReturn($new_program_id); - $this->program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); + $this->project_entity->expects($this->atLeastOnce())->method('getId')->willReturn($new_project_id); + $this->project_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); $expected_scratch_info = [ ['id' => $first_expected_scratch_id, 'creator' => ['username' => 'Techno-CAT']], ['id' => $second_expected_scratch_id, 'creator' => ['username' => 'bubble103']], @@ -184,9 +184,9 @@ public function testCallFetchesScratchProgramDetailsAndAddScratchProgramMethodIf $this->remix_manager ->expects($this->atLeastOnce()) ->method('addScratchProjects')->with($this->isType('array')) - ->will($this->returnCallback(function ($scratch_programs_data) use ($expected_scratch_info) { - $this->assertCount(2, $scratch_programs_data); - $this->assertSame($expected_scratch_info, $scratch_programs_data); + ->will($this->returnCallback(function ($scratch_projects_data) use ($expected_scratch_info) { + $this->assertCount(2, $scratch_projects_data); + $this->assertSame($expected_scratch_info, $scratch_projects_data); })) ; $this->remix_manager @@ -196,10 +196,10 @@ public function testCallFetchesScratchProgramDetailsAndAddScratchProgramMethodIf $this->remix_manager ->expects($this->atLeastOnce()) - ->method('addRemixes')->with($this->isInstanceOf(Program::class)) + ->method('addRemixes')->with($this->isInstanceOf(Project::class)) ; - $this->remix_updater->update($file, $this->program_entity); + $this->remix_updater->update($file, $this->project_entity); } /** @@ -209,7 +209,7 @@ public function testCallFetchesScratchProgramDetailsAndAddScratchProgramMethodIf */ public function testIgnoresMultipleRemixParentsIfCatrobatLanguageVersionIs0992OrLower(): void { - $new_program_id = '3571'; + $new_project_id = '3571'; $first_expected_scratch_id = '118499611'; $second_expected_scratch_id = '70058680'; $current_url = 'Scratch 1 [https://scratch.mit.edu/projects/'.$first_expected_scratch_id @@ -226,8 +226,8 @@ public function testIgnoresMultipleRemixParentsIfCatrobatLanguageVersionIs0992Or } $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); - $this->program_entity->expects($this->atLeastOnce())->method('getId')->willReturn($new_program_id); - $this->program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); + $this->project_entity->expects($this->atLeastOnce())->method('getId')->willReturn($new_project_id); + $this->project_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); $this->async_http_client ->expects($this->atLeastOnce()) ->method('fetchScratchProjectDetails')->with($this->isType('array')) @@ -240,10 +240,10 @@ public function testIgnoresMultipleRemixParentsIfCatrobatLanguageVersionIs0992Or ; $this->remix_manager->expects($this->atLeastOnce())->method('addScratchProjects')->with([]); $this->remix_manager->expects($this->atLeastOnce()) - ->method('addRemixes')->with($this->isInstanceOf(Program::class)) + ->method('addRemixes')->with($this->isInstanceOf(Project::class)) ; $this->remix_manager->expects($this->atLeastOnce())->method('getProjectRepository'); - $this->remix_updater->update($file, $this->program_entity); + $this->remix_updater->update($file, $this->project_entity); } /** @@ -251,13 +251,13 @@ public function testIgnoresMultipleRemixParentsIfCatrobatLanguageVersionIs0992Or * * @psalm-suppress UndefinedPropertyAssignment */ - public function testCallFetchesOnlyDetailsOfNotYetExistingScratchPrograms(): void + public function testCallFetchesOnlyDetailsOfNotYetExistingScratchProjects(): void { - $new_program_id = '3571'; + $new_project_id = '3571'; $first_expected_scratch_id = '118499611'; $second_expected_scratch_id = '70058680'; $expected_scratch_ids = [$first_expected_scratch_id, $second_expected_scratch_id]; - $expected_already_existing_scratch_programs = [$first_expected_scratch_id]; + $expected_already_existing_scratch_projects = [$first_expected_scratch_id]; $current_url = 'Scratch 1 [https://scratch.mit.edu/projects/'.$first_expected_scratch_id .'], Scratch 2 [https://scratch.mit.edu/projects/'.$second_expected_scratch_id.']'; $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); @@ -272,8 +272,8 @@ public function testCallFetchesOnlyDetailsOfNotYetExistingScratchPrograms(): voi } $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); - $this->program_entity->expects($this->atLeastOnce())->method('getId')->willReturn($new_program_id); - $this->program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); + $this->project_entity->expects($this->atLeastOnce())->method('getId')->willReturn($new_project_id); + $this->project_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); $expected_scratch_info = [['id' => $second_expected_scratch_id, 'creator' => ['username' => 'bubble103']]]; $this->async_http_client ->expects($this->atLeastOnce()) @@ -283,22 +283,22 @@ public function testCallFetchesOnlyDetailsOfNotYetExistingScratchPrograms(): voi $this->remix_manager ->expects($this->atLeastOnce()) ->method('filterExistingScratchProjectIds')->with($expected_scratch_ids) - ->willReturn($expected_already_existing_scratch_programs) + ->willReturn($expected_already_existing_scratch_projects) ; $this->remix_manager ->expects($this->atLeastOnce()) ->method('addScratchProjects')->with($this->isType('array')) - ->will($this->returnCallback(function ($scratch_programs_data) use ($expected_scratch_info) { - $this->assertCount(1, $scratch_programs_data); - $this->assertSame($expected_scratch_info, $scratch_programs_data); + ->will($this->returnCallback(function ($scratch_projects_data) use ($expected_scratch_info) { + $this->assertCount(1, $scratch_projects_data); + $this->assertSame($expected_scratch_info, $scratch_projects_data); })) ; $this->remix_manager->expects($this->atLeastOnce()) - ->method('addRemixes')->with($this->isInstanceOf(Program::class)) + ->method('addRemixes')->with($this->isInstanceOf(Project::class)) ; $this->remix_manager->expects($this->atLeastOnce())->method('getProjectRepository'); - $this->remix_updater->update($file, $this->program_entity); + $this->remix_updater->update($file, $this->project_entity); } /** @@ -329,8 +329,8 @@ public function testCallAddRemixesMethodOfRemixManagerWithCorrectRemixesData(): } $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); - $this->program_entity->expects($this->atLeastOnce())->method('getId')->willReturn('3571'); - $this->program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); + $this->project_entity->expects($this->atLeastOnce())->method('getId')->willReturn('3571'); + $this->project_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); $this->async_http_client ->expects($this->atLeastOnce()) ->method('fetchScratchProjectDetails')->with($this->isType('array')) @@ -343,8 +343,8 @@ public function testCallAddRemixesMethodOfRemixManagerWithCorrectRemixesData(): ; $this->remix_manager->expects($this->atLeastOnce()) ->method('addRemixes') - ->will($this->returnCallback(function (Program $project, array $remixes_data) use ($first_expected_url, $second_expected_url) { - $this->assertEquals($this->program_entity, $project); + ->will($this->returnCallback(function (Project $project, array $remixes_data) use ($first_expected_url, $second_expected_url) { + $this->assertEquals($this->project_entity, $project); $this->assertCount(2, $remixes_data); @@ -368,13 +368,13 @@ public function testCallAddRemixesMethodOfRemixManagerWithCorrectRemixesData(): $this->remix_manager ->expects($this->atLeastOnce()) ->method('addScratchProjects')->with($this->isType('array')) - ->will($this->returnCallback(function ($scratch_programs_data) use ($expected_scratch_info) { - $this->assertCount(1, $scratch_programs_data); - $this->assertSame($expected_scratch_info, $scratch_programs_data); + ->will($this->returnCallback(function ($scratch_projects_data) use ($expected_scratch_info) { + $this->assertCount(1, $scratch_projects_data); + $this->assertSame($expected_scratch_info, $scratch_projects_data); })) ; $this->remix_manager->expects($this->atLeastOnce())->method('getProjectRepository'); - $this->remix_updater->update($file, $this->program_entity); + $this->remix_updater->update($file, $this->project_entity); } /** @@ -388,9 +388,9 @@ public function testSavesTheOldUrlToRemixOf(): void $this->getBaseXmlWithUrl($current_url); $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); - $this->program_entity->expects($this->atLeastOnce())->method('getId')->willReturn('3571'); - $this->program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); - $this->remix_updater->update($file, $this->program_entity); + $this->project_entity->expects($this->atLeastOnce())->method('getId')->willReturn('3571'); + $this->project_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); + $this->remix_updater->update($file, $this->project_entity); $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); Assert::assertInstanceOf(\SimpleXMLElement::class, $xml); Assert::assertEquals($xml->header->url, $new_url); @@ -402,25 +402,25 @@ public function testSavesTheOldUrlToRemixOf(): void */ public function testSavesTheScratchUrlToRemixOf(): void { - $expected_scratch_program_id = '70058680'; - $current_url = 'https://scratch.mit.edu/projects/'.$expected_scratch_program_id; + $expected_scratch_project_id = '70058680'; + $current_url = 'https://scratch.mit.edu/projects/'.$expected_scratch_project_id; $new_url = 'http://share.catrob.at/details/3571'; $this->getBaseXmlWithUrl($current_url); $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); - $this->program_entity->expects($this->atLeastOnce())->method('getId')->willReturn('3571'); - $this->program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); + $this->project_entity->expects($this->atLeastOnce())->method('getId')->willReturn('3571'); + $this->project_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); $this->async_http_client->expects($this->atLeastOnce())->method('fetchScratchProjectDetails')->with([])->willReturn([]); $this->remix_manager ->expects($this->atLeastOnce()) - ->method('filterExistingScratchProjectIds')->with([$expected_scratch_program_id]) - ->willReturn([$expected_scratch_program_id]) + ->method('filterExistingScratchProjectIds')->with([$expected_scratch_project_id]) + ->willReturn([$expected_scratch_project_id]) ; $this->remix_manager->expects($this->atLeastOnce())->method('addScratchProjects')->with([]); - $this->remix_manager->expects($this->atLeastOnce())->method('addRemixes')->with($this->isInstanceOf(Program::class)); + $this->remix_manager->expects($this->atLeastOnce())->method('addRemixes')->with($this->isInstanceOf(Project::class)); $this->remix_manager->expects($this->atLeastOnce())->method('getProjectRepository'); - $this->remix_updater->update($file, $this->program_entity); + $this->remix_updater->update($file, $this->project_entity); $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); Assert::assertInstanceOf(\SimpleXMLElement::class, $xml); Assert::assertEquals($xml->header->url, $new_url); @@ -461,13 +461,13 @@ public function testSavesRemixOfMultipleScratchUrlsToRemixOf(): void ->willReturn([]) ; $this->remix_manager->expects($this->atLeastOnce())->method('addScratchProjects')->with([]); - $this->remix_manager->expects($this->atLeastOnce())->method('addRemixes')->with($this->isInstanceOf(Program::class)); + $this->remix_manager->expects($this->atLeastOnce())->method('addRemixes')->with($this->isInstanceOf(Project::class)); $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); - $this->program_entity->expects($this->atLeastOnce())->method('getId')->willReturn('3571'); - $this->program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); + $this->project_entity->expects($this->atLeastOnce())->method('getId')->willReturn('3571'); + $this->project_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); $this->remix_manager->expects($this->atLeastOnce())->method('getProjectRepository'); - $this->remix_updater->update($file, $this->program_entity); + $this->remix_updater->update($file, $this->project_entity); $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); Assert::assertInstanceOf(\SimpleXMLElement::class, $xml); Assert::assertEquals($xml->header->url, $new_url); @@ -483,9 +483,9 @@ public function testUpdateTheRemixOfOfTheEntity(): void $this->getBaseXmlWithUrl($current_url); $file = new ExtractedCatrobatFile(BootstrapExtension::$CACHE_DIR.'base/', '/webpath', 'hash'); - $this->program_entity->expects($this->atLeastOnce())->method('getId')->willReturn('3571'); - $this->program_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); - $this->remix_updater->update($file, $this->program_entity); + $this->project_entity->expects($this->atLeastOnce())->method('getId')->willReturn('3571'); + $this->project_entity->expects($this->atLeastOnce())->method('isInitialVersion')->willReturn(true); + $this->remix_updater->update($file, $this->project_entity); $xml = simplexml_load_file(BootstrapExtension::$CACHE_DIR.'base/code.xml'); Assert::assertInstanceOf(\SimpleXMLElement::class, $xml); /* @psalm-suppress UndefinedPropertyAssignment */ diff --git a/tests/PhpUnit/Project/Scratch/AsyncHttpClientTest.php b/tests/PhpUnit/Project/Scratch/AsyncHttpClientTest.php index f4f3c63175..59bed280ec 100644 --- a/tests/PhpUnit/Project/Scratch/AsyncHttpClientTest.php +++ b/tests/PhpUnit/Project/Scratch/AsyncHttpClientTest.php @@ -27,8 +27,8 @@ public function testInitialization(): void public function testReturnsEmptyArrayWhenNoDetailsCanBeFetched(): void { - $invalid_scratch_program_id = 0; - $scratch_info_data = $this->async_http_client->fetchScratchProjectDetails([$invalid_scratch_program_id]); + $invalid_scratch_project_id = 0; + $scratch_info_data = $this->async_http_client->fetchScratchProjectDetails([$invalid_scratch_project_id]); $this->assertCount(0, $scratch_info_data); } @@ -38,18 +38,18 @@ public function testReturnsEmptyArrayWhenNoIdsAreGiven(): void $this->assertCount(0, $scratch_info_data); } - public function testFetchesScratchProgramDetailsOfSingleProgram(): void + public function testFetchesScratchProjectDetailsOfSingleProject(): void { - $expected_id_of_first_program = 117_697_631; - $scratch_info_data = $this->async_http_client->fetchScratchProjectDetails([$expected_id_of_first_program]); + $expected_id_of_first_project = 117_697_631; + $scratch_info_data = $this->async_http_client->fetchScratchProjectDetails([$expected_id_of_first_project]); $this->assertCount(1, $scratch_info_data); - Assert::assertArrayHasKey($expected_id_of_first_program, $scratch_info_data); - $first_program_data = $scratch_info_data[$expected_id_of_first_program]; - Assert::assertEquals($expected_id_of_first_program, $first_program_data['id']); - Assert::assertArrayHasKey('title', $first_program_data); - Assert::assertArrayHasKey('description', $first_program_data); - Assert::assertArrayHasKey('author', $first_program_data); - Assert::assertEquals('nposss', $first_program_data['author']['username']); + Assert::assertArrayHasKey($expected_id_of_first_project, $scratch_info_data); + $first_project_data = $scratch_info_data[$expected_id_of_first_project]; + Assert::assertEquals($expected_id_of_first_project, $first_project_data['id']); + Assert::assertArrayHasKey('title', $first_project_data); + Assert::assertArrayHasKey('description', $first_project_data); + Assert::assertArrayHasKey('author', $first_project_data); + Assert::assertEquals('nposss', $first_project_data['author']['username']); } public function testHandlesErrorWhenHttpTimeoutIsExceededCorrectly(): void @@ -57,53 +57,53 @@ public function testHandlesErrorWhenHttpTimeoutIsExceededCorrectly(): void // this timeout is so short so that the client will close the connection before the response is received $this->async_http_client = new AsyncHttpClient(['timeout' => 0.01]); - $expected_id_of_first_program = 117_697_631; - $scratch_info_data = $this->async_http_client->fetchScratchProjectDetails([$expected_id_of_first_program]); + $expected_id_of_first_project = 117_697_631; + $scratch_info_data = $this->async_http_client->fetchScratchProjectDetails([$expected_id_of_first_project]); $this->assertCount(0, $scratch_info_data); } - public function testFetchesScratchProgramDetailsOfTwoProgramsAtOnce(): void + public function testFetchesScratchProjectDetailsOfTwoProjectsAtOnce(): void { - $expected_id_of_first_program = 117_697_631; - $expected_id_of_second_program = 118_499_611; + $expected_id_of_first_project = 117_697_631; + $expected_id_of_second_project = 118_499_611; - $scratch_info_data = $this->async_http_client->fetchScratchProjectDetails([$expected_id_of_first_program, $expected_id_of_second_program]); + $scratch_info_data = $this->async_http_client->fetchScratchProjectDetails([$expected_id_of_first_project, $expected_id_of_second_project]); - $this->assertTheTwoFetchedPrograms($scratch_info_data, $expected_id_of_first_program, $expected_id_of_second_program); + $this->assertTheTwoFetchedProjects($scratch_info_data, $expected_id_of_first_project, $expected_id_of_second_project); } - public function testFetchesScratchProgramDetailsOfMoreThanTwoProgramsAtOnceShouldOnlyFetchDetailsOfFirstTwoProgramsBecauseMaximumLimitIsExceeded(): void + public function testFetchesScratchProjectDetailsOfMoreThanTwoProjectsAtOnceShouldOnlyFetchDetailsOfFirstTwoProjectsBecauseMaximumLimitIsExceeded(): void { $this->async_http_client = new AsyncHttpClient(['max_number_of_total_requests' => 2, 'max_number_of_concurrent_requests' => 4]); - $expected_id_of_first_program = 117_697_631; - $expected_id_of_second_program = 118_499_611; - $expected_id_of_third_program = 134_333_442; + $expected_id_of_first_project = 117_697_631; + $expected_id_of_second_project = 118_499_611; + $expected_id_of_third_project = 134_333_442; - $scratch_info_data = $this->async_http_client->fetchScratchProjectDetails([$expected_id_of_first_program, - $expected_id_of_second_program, $expected_id_of_third_program, ]); + $scratch_info_data = $this->async_http_client->fetchScratchProjectDetails([$expected_id_of_first_project, + $expected_id_of_second_project, $expected_id_of_third_project, ]); - $this->assertTheTwoFetchedPrograms($scratch_info_data, $expected_id_of_first_program, $expected_id_of_second_program); + $this->assertTheTwoFetchedProjects($scratch_info_data, $expected_id_of_first_project, $expected_id_of_second_project); } - private function assertTheTwoFetchedPrograms(array $scratch_info_data, int $expected_id_of_first_program, int $expected_id_of_second_program): void + private function assertTheTwoFetchedProjects(array $scratch_info_data, int $expected_id_of_first_project, int $expected_id_of_second_project): void { $this->assertCount(2, $scratch_info_data); - Assert::assertArrayHasKey($expected_id_of_first_program, $scratch_info_data); - Assert::assertArrayHasKey($expected_id_of_second_program, $scratch_info_data); - - $first_program_data = $scratch_info_data[$expected_id_of_first_program]; - Assert::assertEquals($expected_id_of_first_program, $first_program_data['id']); - Assert::assertArrayHasKey('title', $first_program_data); - Assert::assertArrayHasKey('description', $first_program_data); - Assert::assertArrayHasKey('author', $first_program_data); - Assert::assertEquals('nposss', $first_program_data['author']['username']); - - $second_program_data = $scratch_info_data[$expected_id_of_second_program]; - Assert::assertEquals($expected_id_of_second_program, $second_program_data['id']); - Assert::assertArrayHasKey('title', $second_program_data); - Assert::assertArrayHasKey('description', $second_program_data); - Assert::assertArrayHasKey('author', $second_program_data); - Assert::assertEquals('Techno-CAT', $second_program_data['author']['username']); + Assert::assertArrayHasKey($expected_id_of_first_project, $scratch_info_data); + Assert::assertArrayHasKey($expected_id_of_second_project, $scratch_info_data); + + $first_project_data = $scratch_info_data[$expected_id_of_first_project]; + Assert::assertEquals($expected_id_of_first_project, $first_project_data['id']); + Assert::assertArrayHasKey('title', $first_project_data); + Assert::assertArrayHasKey('description', $first_project_data); + Assert::assertArrayHasKey('author', $first_project_data); + Assert::assertEquals('nposss', $first_project_data['author']['username']); + + $second_project_data = $scratch_info_data[$expected_id_of_second_project]; + Assert::assertEquals($expected_id_of_second_project, $second_project_data['id']); + Assert::assertArrayHasKey('title', $second_project_data); + Assert::assertArrayHasKey('description', $second_project_data); + Assert::assertArrayHasKey('author', $second_project_data); + Assert::assertEquals('Techno-CAT', $second_project_data['author']['username']); } } diff --git a/tests/PhpUnit/Studio/StudioManagerTest.php b/tests/PhpUnit/Studio/StudioManagerTest.php index f1ffd649d7..991ddbf8c5 100644 --- a/tests/PhpUnit/Studio/StudioManagerTest.php +++ b/tests/PhpUnit/Studio/StudioManagerTest.php @@ -5,7 +5,7 @@ use App\DB\Entity\Studio\Studio; use App\DB\Entity\Studio\StudioActivity; use App\DB\Entity\Studio\StudioJoinRequest; -use App\DB\Entity\Studio\StudioProgram; +use App\DB\Entity\Studio\StudioProject; use App\DB\Entity\Studio\StudioUser; use App\DB\Entity\User\Comment\UserComment; use App\DB\Entity\User\User; @@ -56,7 +56,7 @@ protected function setUp(): void $this->entity_manager = $kernel->getContainer()->get('doctrine')->getManager(); $studio_repository = $this->entity_manager->getRepository(Studio::class); $studio_activity_repository = $this->entity_manager->getRepository(StudioActivity::class); - $studio_project_repository = $this->entity_manager->getRepository(StudioProgram::class); + $studio_project_repository = $this->entity_manager->getRepository(StudioProject::class); $studio_user_repository = $this->entity_manager->getRepository(StudioUser::class); $user_comment_repository = $this->entity_manager->getRepository(UserComment::class); $studio_join_request_repository = $this->entity_manager->getRepository(StudioJoinRequest::class); @@ -236,7 +236,7 @@ public function testAddRemoveStudioProject(): void $this->object->addUserToStudio($this->user, $this->studio, $newUser); $this->object->addUserToStudio($this->user, $this->studio, $newUser_2); $studio_project = $this->object->addProjectToStudio($newUser, $this->studio, $project); - $this->assertInstanceOf(StudioProgram::class, $studio_project); + $this->assertInstanceOf(StudioProject::class, $studio_project); $this->object->deleteProjectFromStudio($newUser_2, $this->studio, $project); $this->assertNotNull($this->object->findStudioProject($this->studio, $project)); $this->object->deleteProjectFromStudio($newUser, $this->studio, $project); diff --git a/tests/PhpUnit/Translation/TranslationDelegateTest.php b/tests/PhpUnit/Translation/TranslationDelegateTest.php index a4058fba7d..269a54f1bf 100644 --- a/tests/PhpUnit/Translation/TranslationDelegateTest.php +++ b/tests/PhpUnit/Translation/TranslationDelegateTest.php @@ -2,7 +2,7 @@ namespace Tests\PhpUnit\Translation; -use App\DB\Entity\Project\Program; +use App\DB\Entity\Project\Project; use App\DB\EntityRepository\Translation\ProjectCustomTranslationRepository; use App\DB\EntityRepository\Translation\ProjectMachineTranslationRepository; use App\Translation\TranslationApiInterface; @@ -132,7 +132,7 @@ public function testTranslateProjectWithOnlyName(): void ->willReturn($translation_result) ; - $project = new Program(); + $project = new Project(); $project->setName('name'); $translation_delegate = new TranslationDelegate($this->project_custom_translation_repository, $this->project_machine_translation_repository, $api); @@ -151,7 +151,7 @@ public function testTranslateProjectWithDescriptionAndCredit(): void ->willReturn($translation_result) ; - $project = new Program(); + $project = new Project(); $project->setName('name'); $project->setDescription('description'); $project->setCredits('credit'); @@ -171,7 +171,7 @@ public function testTranslateProjectFailure(): void ->willReturn(null) ; - $project = new Program(); + $project = new Project(); $project->setName('name'); $project->setDescription('description'); $project->setCredits('credit'); @@ -186,7 +186,7 @@ public function testTranslateProjectFailure(): void public function testAddProjectCustomTranslation(): void { $translation_delegate = new TranslationDelegate($this->project_custom_translation_repository, $this->project_machine_translation_repository); - $project = new Program(); + $project = new Project(); $this->project_custom_translation_repository->expects($this->once()) ->method('addNameTranslation') @@ -224,7 +224,7 @@ public function testCachedProjectTranslation(): void $translation_delegate = new TranslationDelegate($this->project_custom_translation_repository, $this->project_machine_translation_repository, $api); - $actual_result = $translation_delegate->translateProject(new Program(), 'en', 'fr'); + $actual_result = $translation_delegate->translateProject(new Project(), 'en', 'fr'); $this->assertEquals($cached_translation, $actual_result); } diff --git a/tests/PhpUnit/User/UserManagerTest.php b/tests/PhpUnit/User/UserManagerTest.php index 33c27b9190..921a0da87f 100644 --- a/tests/PhpUnit/User/UserManagerTest.php +++ b/tests/PhpUnit/User/UserManagerTest.php @@ -33,7 +33,7 @@ protected function setUp(): void $repository = $this->createMock(EntityRepository::class); $object_manager->expects($this->any())->method('getClassMetadata')->willReturn($meta); $object_manager->expects($this->any())->method('getRepository')->willReturn($repository); - $program_manager = $this->createMock(ProjectManager::class); + $project_manager = $this->createMock(ProjectManager::class); $user_finder = $this->createMock(TransformedFinder::class); $user_repository = $this->createMock(UserRepository::class); $url_helper = new UrlHelper(new RequestStack()); @@ -42,7 +42,7 @@ protected function setUp(): void $userPasswordHasher, $object_manager, $user_finder, - $program_manager, + $project_manager, $url_helper, $user_repository );