@@ -82,17 +82,6 @@ public static function getAllTagsDataProvider(): array {
8282					['two ' , false , false ],
8383				]
8484			],
85- 			[
86- 				// duplicate names, different flags 
87- 				[
88- 					['one ' , false , false ],
89- 					['one ' , true , false ],
90- 					['one ' , false , true ],
91- 					['one ' , true , true ],
92- 					['two ' , false , false ],
93- 					['two ' , false , true ],
94- 				]
95- 			]
9685		];
9786	}
9887
@@ -163,14 +152,14 @@ public static function getAllTagsFilteredDataProvider(): array {
163152			[
164153				[
165154					['one ' , true , false ],
166- 					['one ' , false , false ],
155+ 					['one_different ' , false , false ],
167156					['two ' , true , false ],
168157				],
169158				null ,
170159				'on ' ,
171160				[
172161					['one ' , true , false ],
173- 					['one ' , false , false ],
162+ 					['one_different ' , false , false ],
174163				]
175164			],
176165			// filter by name pattern and visibility 
@@ -179,12 +168,13 @@ public static function getAllTagsFilteredDataProvider(): array {
179168				[
180169					['one ' , true , false ],
181170					['two ' , true , false ],
182- 					['one ' , false , false ],
171+ 					['one_different ' , false , false ],
183172				],
184173				true ,
185174				'on ' ,
186175				[
187176					['one ' , true , false ],
177+ 					['one_different ' , false , false ],
188178				]
189179			],
190180			// filter by name pattern in the middle 
@@ -246,6 +236,15 @@ public function testCreateDuplicate($name, $userVisible, $userAssignable): void
246236		$ this tagManager ->createTag ($ name$ userVisible$ userAssignable
247237	}
248238
239+ 	public  function  testCreateDuplicateWithDifferentFlags (): void  {
240+ 		$ this expectException (TagAlreadyExistsException::class);
241+ 
242+ 		// Create a tag with specific flags 
243+ 		$ this tagManager ->createTag ('duplicate ' , true , false );
244+ 		// Try to create a tag with the same name but different flags - should fail 
245+ 		$ this tagManager ->createTag ('duplicate ' , false , true );
246+ 	}
247+ 
249248	public  function  testCreateOverlongName (): void  {
250249		$ tag$ this tagManager ->createTag ('Zona circundante do Palácio Nacional da Ajuda (Jardim das Damas, Salão de Física, Torre Sineira, Paço Velho e Jardim Botânico) ' , true , true );
251250		$ this assertSame ('Zona circundante do Palácio Nacional da Ajuda (Jardim das Damas ' , $ taggetName ()); // 63 characters but 64 bytes due to "á" 
@@ -349,30 +348,20 @@ public function testUpdateTag($tagCreate, $tagUpdated): void {
349348
350349	}
351350
352- 	#[\PHPUnit \Framework \Attributes \DataProvider('updateTagProvider ' )]
353- 	public  function  testUpdateTagDuplicate ($ tagCreate$ tagUpdatedvoid  {
351+ 	public  function  testUpdateTagToExistingName (): void  {
354352		$ this expectException (TagAlreadyExistsException::class);
355353
356- 		$ this tagManager ->createTag (
357- 			$ tagCreate0 ],
358- 			$ tagCreate1 ],
359- 			$ tagCreate2 ],
360- 			$ tagCreate3 ],
361- 		);
362- 		$ tag2$ this tagManager ->createTag (
363- 			$ tagUpdated0 ],
364- 			$ tagUpdated1 ],
365- 			$ tagUpdated2 ],
366- 			$ tagUpdated3 ],
367- 		);
354+ 		// Create two different tags 
355+ 		$ tag1$ this tagManager ->createTag ('first ' , true , true );
356+ 		$ tag2$ this tagManager ->createTag ('second ' , false , false );
368357
369- 		// update to match  the first tag  
358+ 		// Try to  update tag2  to have  the same name as tag1 - should fail  
370359		$ this tagManager ->updateTag (
371360			$ tag2getId (),
372- 			$ tagCreate [ 0 ] ,
373- 			$ tagCreate [ 1 ] ,
374- 			$ tagCreate [ 2 ] ,
375- 			$ tagCreate [ 3 ], 
361+ 			' first ' 
362+ 			false ,
363+ 			false ,
364+ 			null 
376365		);
377366	}
378367
0 commit comments