                     let resourcesPhases = pbxProject.resourcesBuildPhases.filter { buildPhases.contains($0) }
                     let frameworkPhases = pbxProject.frameworksBuildPhases.filter { buildPhases.contains($0) }
                     let copyFilesPhases = pbxProject.copyFilesBuildPhases.filter { buildPhases.contains($0) }
+                    let embedFrameworkPhase = copyFilesPhases.first { $0.dstSubfolderSpec == .frameworks }
+                    let copyBundlesPhase = copyFilesPhases.first { $0.dstSubfolderSpec == .resources }
 
                     // All targets should have a compile sources phase,
                     // except for the sticker pack one

                //

                var expectedResourceFiles: [String: Set<String>] = [:]
                var expectedLinkedFiles: [String: Set<String>] = [:]
                var expectedEmbeddedFrameworks: [String: Set<String>] = [:]


                        try expect(Set(linkFrameworks)) == expectedLinkedFiles
                    }

                    var expectedCopyFilesPhasesCount = 0
                    // ensure only the right things are embedded, no more, no less
                    if let expectedEmbeddedFrameworks = expectedEmbeddedFrameworks[target.name], !expectedEmbeddedFrameworks.isEmpty {
                        expectedCopyFilesPhasesCount += 1
                        let copyFiles = (embedFrameworkPhase?.files ?? [])
                            .compactMap { $0.file?.nameOrPath }
                        try expect(Set(copyFiles)) == expectedEmbeddedFrameworks
                    }

                    if let expectedBundlesFiles = expectedBundlesFiles[target.name],
                        target.type != .staticLibrary && target.type != .dynamicLibrary {
                        expectedCopyFilesPhasesCount += 1
                        let copyBundles = (copyBundlesPhase?.files ?? [])
                            .compactMap { $0.file?.nameOrPath }
                        try expect(Set(copyBundles)) == expectedBundlesFiles
                    }
                    print(target.name)
                    try expect(copyFilesPhases.count) == expectedCopyFilesPhasesCount
                }
            }

